Part Number Hot Search : 
967210 NDUCTOR 00GB1 900X0 DIN05S LT9040D BZX55C75 20010
Product Description
Full Text Search
 

To Download TMC5062 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  power driver for stepper motors integrated circuits trinamic motion control gmbh & co. kg hamburg, germany TMC5062 datasheet b lock d iagram f eatures and b enefits two 2 - phase stepper motors drive capability up to 2 x 1.1a coil current motion controller with sixpoint ? ramp voltage range 4.75 20v dc spi & single wire uart dual abn enco der interface 2x ref. - switch input per axis highest resolution 256 microsteps per full step full protection & diagnostics dcstep? load dependent speed control C no step loss stallguard 2? high precision sensorless motor load detection coolstep? load depende nt current sav es up to 75% energy spreadcycle? high - precision chopper for best current sine wave form and zero crossing with additional chopsync 2 ? compact size 7x7mm 2 qfn48 package d escription the tmc5 062 is a high performance motion controller and d river for up to two stepper motors. it combines two flexible ramp motion controllers with energy efficient stepper motor drivers. the driver s support two - phase stepper motors and offer an industry - leading feature set, including high - resolution microsteppin g, sensorless mechanical load measurement, load - adaptive velocity and power optimization, and low - resonance chopper operation. standard spi? interface and an optional uart based single wire interface simplify communication. integrated protection and diagno stic features support robust and reliable operation. high integration, high energy efficiency and small form factor enable miniaturized designs with low external component count for cost - effective and highly competitive solutions. a pplications cctv, security antenna positioning heliostat controller battery powered applications office automation atm, cash recycler , pos lab automation liq uid handling medical printer and scanner pumps and valves dual , cost - effective controller and driver for up to two 2 - phase bipolar stepper motors . integrated motion controller with spi interface. m o t i o n c o n t r o l l e r w i t h l i n e a r 6 p o i n t r a m p g e n e r a t o r m o t i o n c o n t r o l l e r w i t h l i n e a r 6 p o i n t r a m p g e n e r a t o r d r i v e r 1 d r i v e r 2 t m c 5 0 6 2 p r o t e c t i o n & d i a g n o s t i c s p r o g r a m m a b l e 2 5 6 s t e p s e q u e n c e r p r o g r a m m a b l e 2 5 6 s t e p s e q u e n c e r p r o t e c t i o n & d i a g n o s t i c s e n c o d e r u n i t a b n e n c o d e r i n p u t 2 x r e f . s w i t c h e s 2 x r e f . s w i t c h e s s p i u a r t s t a l l g u a r d 2 c o o l s t e p d c s t e p p o w e r s u p p l y c h a r g e p u m p e n c o d e r u n i t a b n e n c o d e r i n p u t m o t o r 1 m o t o r 2
TMC5062 datasheet (rev. 1 . 10 / 2016 - apr - 28 ) 2 www.trinamic.com application examples: high flexibility C multipurpose use the TMC5062 score s with power density , complete motion controlling features and integrated power stages . it offers a versatility that covers a wide spectrum of applications from battery systems up to embedded applications with 1 . 1 a rms motor current per coil . the small form factor keep s costs down and allow s for miniaturized layouts . extensive support at the chip, boar d, and software levels enables rapid design cycles and fast time - to - market with competitive products. high energy efficiency and reliability from trinamics coolstep and dcstep techno logies deliver cost savings in related systems such as power supplies and cooling. o rder c odes order code description size [ mm 2 ] TMC5062 - la dual dcstep ? and coolstep ? controller/driver, qf n 48 7 x 7 tmc5 062 - eval evaluation board for tmc5 06 2 85 x 55 startrampe baseboard for TMC5062 - eval and further evaluation boards 85 x 55 eselsbrcke connector board for plug - in evaluation board system 61 x 38 the stepper motor driver outputs are switched in parallel. a dual abn encoder interface and two reference switch inputs are used. a n application with two stepper motors is shown. additionally the abn enco der interface and two reference switches can be used for each motor. a single cpu control s the whole system. the cpu - board and controller / driver boards are highly economical and space saving. a uart interface can be used as an option to spi for pin coun t limited controller or remote drives. tmc50 6 2 - eval e valuation b oard e valuation & development platform the tmc50 6 2 - eval is part of trinamics universal evaluation board system which provides a convenient handling of the hardware as well as a user - friendl y software tool for evaluation. the tmc5 062 evaluation board system consists of three parts: startrampe (base board), eselsbrcke (connector board including several test points), and tmc5 062 - eval. c p u t m c 5 0 6 2 h i g h - l e v e l i n t e r f a c e s p i c p u h i g h - l e v e l i n t e r f a c e t m c 5 0 6 2 u a r t e x a m p l e d e s i g n w i t h o n e s t e p p e r m o t o r c o m p a c t d e s i g n f o r t w o s t e p p e r m o t o r s m e n c o d e r r e f . s w i t c h e s m o t o r 1 m o t o r 2 m m
TMC5062 datasheet (rev. 1 . 10 / 2016 - apr - 28 ) 3 www.trinamic.com t able of c ontents 1 principles of operat ion 5 1.1 k ey c oncepts 5 1.2 c ontrol i nterfaces 6 1.3 s oftware 6 1.4 m oving and c ontrolling the m otor 7 1.5 p recision d river with p rogrammable m icrostepping w ave 7 1.6 stall g uard 2 C m echanical l oad s ensing 7 1.7 cool s tep C l oad a daptive c urrent c ontrol 7 1.8 dc s tep C l oad d ependent s peed c ontrol 8 1.9 e ncoder i nterfaces 8 2 pin assignments 9 2.1 p ackage o utline 9 2.2 s ignal d escriptions 9 3 sample circuits 12 3.1 s tandard a pplication c ircuit 12 3.2 5 v o nly s upply 14 3.3 e xternal vcc s upply 15 3.4 o ptimizing a nalog p recision 16 3.5 d river p rotection and eme c ircuitry 17 4 spi interface 18 4.1 spi d atagram s tructure 18 4.2 spi s ignals 19 4.3 t iming 20 5 uart single wire int erface 21 5.1 d atagram s tructure 21 5.2 crc c alculation 23 5.3 uart s ignals 24 6 register mapping 25 6.1 g eneral c onfiguration r egisters 26 6.2 r amp g enerator r egisters 28 6.3 e ncoder r egisters 34 6.4 m otor d river r egiste rs 36 7 current setting 43 7.1 s ense r esistors 44 8 chopper operati on 45 8.1 spread c ycle c hopper 46 8.2 c lassic 2 - p hase m otor c onstant o ff t ime c hopper 49 8.3 r andom o ff t ime 50 8.4 chop s ync 2 for q uiet m otors 51 9 driver diagnostic fl ags 52 9.1 t emperature m easurement 52 9.2 s hort to gnd p rotection 52 9.3 o pen l oad d iagnostics 52 10 ramp generator 53 10.1 r eal w orld u nit c onversion 53 10.2 m otio n p rofiles 54 10.3 i nterrupt h andling 55 10.4 v elocity t hresholds 55 10.5 r eference s witches 57 10.6 r estrictions of r amp g enerator (e rrata ) 58 11 stallguard2 load mea surement 61 11.1 t uning the stall g uard 2 t hreshold sgt 62 11.2 stall g uard 2 u pdate r ate and f ilter 64 11.3 d etecting a m otor s tall 64 11.4 h oming with stall g uard 64 11.5 l imits of stall g uard 2 o peration 64 12 coolstep operation 65 12.1 u ser b enefits 65 12.2 s etting up for cool s tep 65 12.3 t uning cool s tep 67 13 dcstep 68 13.1 u ser b enefits 68 13.2 d esigning - i n dc s tep 68 13.3 e nabling dc s tep 69 13.4 s tall detection in dc s tep mode 69 13.5 m easuring a ctual m otor v elocity in dc s tep o peration 70 14 sine - wave look - up table 71 14.1 u ser b enefits 71 14.2 m icrostep t able 71 15 abn incremental enco der interface 73 15.1 e ncoder t iming 74 15.2 s etting the e ncoder to m atch m otor r esolution 74 15.3 c l osing the l oop 74 16 quick configuration guide 76 17 getting started 80 17.1 i nitialization e xamples 80 18 clock oscillator and clock input 81 18.1 u sing the i nternal c lock 81 18.2 u sing an e xternal c lock 81 18.3 c onsiderations on the f requency 81 19 absolute maxi mum ratings 83 20 electrical character istics 83 20.1 o perational r ange 83 20.2 dc c haracteristics and t iming c haracteristics 84 20.3 t hermal c haracteristics 86 21 layout consideration s 87 21.1 e xposed d ie p ad 87 21.2 w iring gnd 87 21.3 s upply f iltering 87
TMC5062 datasheet (rev. 1 . 10 / 2016 - apr - 28 ) 4 www.trinamic.com 21.4 l ayout e xample 88 22 package mechanical d ata 89 22.1 d imensional d rawi ngs 89 22.2 p ackage c odes 89 23 disclaimer 90 24 esd sensitive devi ce 90 25 table of figures 91 26 revision history 92 27 references 92
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 5 www.trinamic.com 1 principles of operation figure 1 . 1 basic application and block diagram the TMC5062 motion controller and driver chip is an intelligent powe r component interfacing between the cpu and up to two stepper motors . all stepper motor logic is completely within the tmc 5062 . no software is required to control the motor C just provide target positions. the TMC5062 offers a number of unique enhancements which are enabled by the system - on - chip integration of driver and controller. the sixpoint ramp generator of the TMC5062 uses dcstep, coolstep, and stallguard2 automatically to optimize every motor movement : trinamics special features contribute toward lo wer system cost, greater precision, greater energy efficiency, smoother motion, and cooler operation in stepper motor applications. the clear conce pt and the comprehensive solution save design - in time . 1.1 key concepts the TMC5062 implement s several advanced features which are exclusive to trinamic products. these features contribute toward greater precision, greater energy efficiency, higher reliability, smoother motion, and cooler operation in many stepper motor applications. dcstep? load dependent speed co ntrol. the motor moves as fast as possible and never loses a step. stallguard2 ? h igh - precision load measurement using the back emf on the motor coils . coolstep ? l oad - adaptive current control which reduces energy consumption by as much as 75% . spreadcycle ? h igh - precision chopper algorithm available as an alternative to the traditional constant off - time algorit hm . s ixpoint ? fast and precise positioning using a hardware ramp generator with a set of four acceleration / deceleration settings . quickest response due to dedicated hardware. d i f f . t r a n c e i v e r h a l f b r i d g e 2 h a l f b r i d g e 1 h a l f b r i d g e 1 h a l f b r i d g e 2 + v m v s 2 x c u r r e n t c o m p a r a t o r 2 p h a s e s t e p p e r m o t o r n s s t e p p e r d r i v e r p r o t e c t i o n & d i a g n o s t i c s p r o g r a m m a b l e s i n e t a b l e 4 * 2 5 6 e n t r y 2 x d a c s t a l l g u a r d 2 ? c o o l s t e p ? x o 1 a 1 o 1 a 2 b r 1 a / b r s e n s e r s e n s e o 1 b 1 o 1 b 2 c h o p p e r v c c _ i o t m c 5 0 6 2 d u a l s t e p p e r m o t o r d r i v e r / c o n t r o l l e r s p i i n t e r f a c e c s n / i o 0 s c k / i o 1 s d o / i o 3 s d i / i o 2 2 x l i n e a r 6 p o i n t r a m p g e n e r a t o r r e f e r e n c e s w i t c h p r o c e s s i n g s t e p & d i r e c t i o n p u l s e g e n e r a t i o n r e f l 1 s t e p p e r # 1 m o t i o n c o n t r o l c o o l s t e p m o t o r d r i v e r r e f r 1 h a l f b r i d g e 2 h a l f b r i d g e 1 h a l f b r i d g e 1 h a l f b r i d g e 2 + v m v s 2 x c u r r e n t c o m p a r a t o r 2 p h a s e s t e p p e r m o t o r n s p r o g r a m m a b l e s i n e t a b l e 4 * 2 5 6 e n t r y 2 x d a c s t a l l g u a r d 2 ? c o o l s t e p ? x o 2 a 1 o 2 a 2 b r 2 a / b r s e n s e r s e n s e o 2 b 1 o 2 b 2 c h o p p e r r e f e r e n c e s w i t c h p r o c e s s i n g s t e p & d i r e c t i o n p u l s e g e n e r a t i o n s t e p p e r # 2 c o o l s t e p m o t o r d r i v e r 2 x l i n e a r 6 p o i n t r a m p g e n e r a t o r m o t i o n c o n t r o l c o n t r o l r e g i s t e r s e t s i n g l e w i r e i n t e r f a c e c l k o s c i l l a t o r / s e l e c t o r 5 v v o l t a g e r e g u l a t o r t e m p e r a t u r e m e a s u r e m e n t c h a r g e p u m p c p o c p i v c p 2 2 n 1 0 0 n s w i o n s w _ s e l c l k _ i n i n t e r f a c e r e f l 2 r e f r 2 s w i o p + v m 5 v o u t v s a 4 . 7 + v i o d u a l e n c o d e r u n i t e n c 1 a e n c 1 b i o 0 / s w i o p / r e f l 1 1 a 1 b 1 n 2 a 2 b 2 n r e f r 1 r e f r 2 i o 1 / s w i o n / r e f l 2 e n c 1 a / i n t e n c 1 b / p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n s i n g l e d r v g n d p g n d p g n d g n d a f f f f f f f f f f = 6 0 n s s p i k e f i l t e r t s t _ m o d e d c s t e p ? d c s t e p ? d i e p a d v c c r s e n s e = 0 r 2 5 a l l o w s f o r m a x i m u m c o i l c u r r e n t s p i ? s i n g l e w i r e u a r t o p t . e x t . c l o c k 1 2 - 1 6 m h z 3 . 3 v o r 5 v i / o v o l t a g e 1 0 0 n 1 0 0 n 1 0 0 n 1 0 0 n i n t e r f a c e s e l e c t i o n e n c o d e r o r i n t e r r u p t o u t r e f . / s t o p s w i t c h e s ( m o t o r 2 ) r e f . / s t o p s w i t c h e s ( m o t o r 1 ) o p t . d r i v e r e n a b l e
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 6 www.trinamic.com in addition to these performance enhancements, trinamic motor drivers also offer safeguards to detect and protect against shorted outputs, output open - circuit, overtemperature, and undervoltage conditions for enhancing safety a nd recovery from equipment malfunctions. 1.2 control interfac es the TMC5062 supports both, an spi and a uart based single wire interface with crc checking. selection of the actual interface is done via the configuration pin sw_sel, which can be hardwired to g nd or vcc_io depending on the desired interface. 1.2.1 spi interface the spi interface is a bit - serial interface synchronous to a bus clock. for every bit sent from the bus master to the bus slave, another bit is sent simultaneously from the slave to the maste r. communication betw een an spi master and the TMC5062 slave always consists of sending one 4 0 - bit command word and receiving one 4 0 - bit status word. the spi command rate typically is a few commands per complete motor motion . 1.2.2 uart interface the single wi re interface allows differential operation similar to rs485 (using swiop and swion) or single wire interfacing (leaving open swion). it can be driven by any standard uart. no baud rate configuration is required. 1.3 software from a software point of view the TMC5062 is a peripheral with a number of control and status registers. m ost of them can either be written only or read only, some of the registers allow both read and write access. in case read - modify - write access is desired for a write only register, a sh adow register can be realized in master software.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 7 www.trinamic.com 1.4 moving and controlling the motor 1.4.1 integrated motion controller the integrated 32 bit motion controller automatically drives the motors to target positions, or accelerates to target velocities. all motion parameters can be changed on the fly . t he motion controller recalculat es immediately. a minimum set of configuration data consists of acceleration and deceleration values and the maximum motion velocity. a start and stop velocity is supported as well as a second acceleration and deceleration setting. the integrated motion controller supports immediate reaction to mechanical reference switches and to the sensorless stall detection stallguard 2. b enefits are: - flexible ramp programming - efficient use of motor t orque for acceleration and deceleration a llows higher machine throughput - immediate reacti on to stop and stall conditions 1.5 precision driver with programmable microstepping wave current into the motor coils is controlled using a cycle - by - cycle chopper mode. two chopper modes are available: a traditional constant off - time mode and the new spreadcycle mode. constant off - time mode provides higher torque at the highest velocity, while spreadcycle mode offers smoother operation and greater power efficiency over a wide range of speed and load. the spreadcycle chopper scheme automatically integrates a fast decay cycle and guarantees smooth zero crossing performance. programmable microstep shapes allow optimizing the motor performance. benefits are: - significantly im proved microstepping with low cost motors - motor runs smooth and quiet - reduced mechanical resonances yields improved torque 1.6 stallguard 2 C mechanical load sensing stallguard2 provides an accurate measurement of the load on the motor. it can be used for stal l detection as well as other uses at loads below those which stall the motor, such as coolstep load - adaptive current reduction. this gives more information on the drive allowing functions like sensorless homing and diagnostics of the drive mechanics. 1.7 coo lstep C load adaptive current control coolstep drives the motor at the optimum current. it uses the stallguard 2 load measurement information to adjust the motor current to the minimum amount required in the actual load situation. this saves energy and keep s the components cool, making the drive an efficient and precise solution. benefits are: - energy efficiency power consumption decreased up to 75% - motor generates less heat improved mechanical precision - less or no cooling improved reliability - use of smaller motor less torque reserve required cheaper motor does the job figure 1 . 2 shows the efficiency gain of a 42mm stepper motor when using coolstep compared to standard operation with 50% of torque reserve. coolstep is enabled above 60rpm in the example.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 8 www.trinamic.com figure 1 . 2 energy efficiency with coolstep (example) 1.8 dcstep C load dependent speed control dcstep allows the motor to run near its load lim it and at its velocity limit without losing a step. if the mechanical load on the motor increases to the stalling load, the motor automatically decreases velocity so that it can still drive the load. with this feature, the motor will never stall. in additi on to the increased torque at a lower velocity, dynamic inertia w ill allow the motor to overcome mechanical overloads by decelerating. dcstep directly integrates with the ramp generator, so that the target position will be reached, even if the motor veloci ty needs to be decreased due to inc reased mechanical load. a dynamic range of up to factor 10 or more can be covered by dcstep without any step loss. by optimizing the motion velocity in high load situations, this feature further enhances overall system ef ficiency. benefits are: - motor does not loose steps in overload conditions - application works as fast as possible - h ighest possible acceleration automatically - highest energy efficiency at speed limit - highest possible motor torque using fullstep drive - cheaper motor does the job 1.9 encoder interfaces the tmc5072 provides two encoder interfaces for external incremental encoders. the encoders can be used for homing of the motion controllers (alternatively to reference switches) and for consistency checks on - the - fly between encoder position and ramp generator position. a programmable prescaler allows the adaptation of the encoder resolution to the motor resolution. 32 bit encoder counters are provided. 0 0 , 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 e f f i c i e n c y v e l o c i t y [ r p m ] e f f i c i e n c y w i t h c o o l s t e p e f f i c i e n c y w i t h 5 0 % t o r q u e r e s e r v e
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 9 www.trinamic.com 2 pin assignments 2.1 package outline f igure 2 . 1 TMC5062 pin assignments. 2.2 signal descriptions pin number type function gnd 6, 24, 34 gnd digital ground pin for io pins and digital circuitry. vcc_io 7 3.3v or 5v i/o supply voltage pin for all digital pin s. vsa 30 analog supply voltage for 5v regulator C typically supplied with driver supply voltage. an additional 100nf capacitor to gnd (gnd plane) is recommended for best performance. gnda 31 gnd analog gnd. tie to gnd plane. 5vout 32 outpu t of internal 5v regulator. attach 2.2 f or larger ceramic capacitor to gnda near to pin for best performance. may be used to supply vcc of chip. t m c 5 0 6 2 - l a q f n 4 8 7 m m x 7 m m 0 . 5 p i t c h r e f l 1 c p o g n d p t s t _ m o d e o 1 a 1 v s o 1 b 1 b r 1 a o 1 a 2 v s o 1 b 2 v c c _ i o e n c 1 b / p p o 2 a 2 b r 2 a b r 2 b v s o 2 b 2 v s o 2 b 1 1 e n c 1 a / i n t s d o / i o 3 s w i o p g n d s d i / i o 2 s c k / i o 1 c s n / i o 0 r e f r 1 r e f l 2 v s a g n d a g n d c p i c l k s w i o n g n d p r e f r 2 b r 1 b o 2 a 1 2 3 4 5 6 7 8 9 1 0 1 1 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 3 6 3 5 3 4 3 3 3 2 3 1 3 0 2 9 2 8 2 7 2 6 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 3 9 3 8 d r v _ e n n v c p 3 7 2 5 - 1 3 1 2 - s w s e l - v c c g n d 5 v o u t
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 10 www.trinamic.com pin number type function vcc 33 5v supply input for digital circuitry within chip and charge pump. attach 470nf capacitor to gnd (gnd plane). may be supplied by 5vout. a 2 .2? resistor is recommended for decoupling noise from 5vout. when using an external supply, make sure, that vcc comes up before or in parallel to 5vout. die_pad - gnd connect the exposed die pad to a gnd plane. provide as many as possible vias for heat tr ansfer to gnd plane. t able 2 . 1 low voltage digital and analog power supply pins pin number type function cpo 35 o(vcc) charge pump driver output. outputs 5v (gnd to vcc) square wave with 1/16 of internal os cillator frequency. cpi 36 i(vcp) charge pump capacitor input: provide external 22 nf / 50 v capacitor to cpo. vcp 37 output of charge pump. provide external 100 nf capacitor to vs. t able 2 . 2 charge pump pins pin number type function enc1a/int 1 i/o input a for incremental encoder 1. c an be programmed to provide interrupt output based on ramp generator flags ramp_stat bits 4, 5, 6 & 7 and encoder null event status enc_status bit 0 ( poscmp_enable =1 ). enc1b/pp 2 i/o input b for incremental encoder 1. can be programmed to provide position compare output for motor 1 ( poscmp_enable =1 ). csn/io0 3 i/o chip select input of spi interface, programmable io in uart mode sck/io1 4 i/o serial clock input of spi interface, programmable io in uart mode sdi/io2 5 i/o data input of spi interface, prog rammable io in uart mode sdo/io3 8 i/o data output of spi interface (tristate, enabled with csn=0), programmable io in uart mode swiop 9 i/o single wire uart interface i/o. has internal 100k pulldown resistor. multi - purpose input in spi mode. swion 10 i /o single wire i/o (negative) for differential mode. leave open in non - differential mode when operating at 5v io voltage or tie to desired threshold voltage. serial output in ring mode. multi - purpose input in spi mode or encoder 2 n input. clk 11 i clock input . tie to gnd using short wire for internal clock or supply external clock . the first high signal disables the internal oscillator until power down. swsel 12 i interface selection input. tie to gnd for spi mode, tie to vcc_io for single wire (uart) in terface mode. refr2 25 i right reference switch input for motor 2 refl2 26 i left reference switch input for motor 2 refr1 27 i right reference switch input for motor 1 refl1 28 i left reference switch input for motor 1 drv_enn 29 i enable i nput for m otor drivers. the power stage becomes switched off (all motor outputs floating) when this pin becomes driven to a high level . tie to gnd for normal operation. tst_mode 48 i test mode input. tie to gnd using short wire. - 13, 23, 38 n.c. unused pins C no internal electrical connection. leave open or tie to gnd for compatibility with future devices. t able 2 . 3 digital i/o pins (all related to vcc_io supply)
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 11 www.trinamic.com pin number type function o2a1 14 o (vs) motor 2 co il a output 1 br2a 15 sense resistor connection for m otor 2 coil a . place sense resistor to gnd near pin . o2a2 16 o (vs) motor 2 coil a output 2 vs 17, 19 motor supply voltage. provide filtering capacity near pin with shortest loop to nearest gndp pin (respectively via gnd plane). gndp 18 gnd power gnd. connect to gnd plane near pin. o2b1 20 o (vs) motor 2 coil b output 1 br2b 21 sense resistor connection for m otor 2 coil b. place sense resistor to gnd near pin . o2b2 22 o (vs) motor 2 coil b outpu t 2 o1b2 39 o (vs) motor 1 coil b output 2 br1b 40 sense resistor connection for m otor 1 coil b. place sense resistor to gnd near pin . o1b1 41 o (vs) motor 1 coil b output 1 vs 42, 44 motor supply voltage. provide filtering capacity near pin with sho rtest loop to nearest gndp pin (respectively via gnd plane). gndp 43 gnd power gnd. connect to gnd plane near pin. o1a2 45 o (vs) motor 1 coil a output 2 br1a 46 sense resistor connection for m otor 1 coil a . place sense resistor to gnd near pin . o1a1 47 o (vs) motor 1 coil a output 1 t able 2 . 4 power driver pins
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 12 www.trinamic.com 3 sample circuits the sample circuits show the connection of the external components in different operation and supply modes. the connection of th e bus interface and further digital signals is left out for clarity. 3.1 standard application circuit figure 3 . 1 standard application circuit the standard application circuit uses a minimum set of additional components in order to operate the motor. use low esr capacitors for filtering the power supply capable to cope with the current ripple. the current ripple often depends on the power supply and cable length. the vcc_io voltage can be supplied from 5vout, or from a fast startup 3.3v regulator. in order to minimize linear voltage regulator power dissipation of the internal 5v voltage regulator in applications where vm is high, a different (lower) supply voltage can be used for vsa, i f available. for best motor chopper performance, an optional r/c - filter de - couples 5vout from digital noise cause by power drawn from vcc. basic layout hints place sense resistors and all filter capacitors as close as possible to the related ic pins. use a solid common gnd for all gnd connections, also for sense resistor gnd. connect 5vout filtering capacitor directly to 5vout and gnda pin. see layout hints for more details. low esr electrolytic capacitors are recommended for vs filtering. attention in c ase vsa is supplied by a different voltage source, make sure that vsa does not exceed vs by more than one diode drop upon power up or power down. t m c 5 0 6 2 s p i i n t e r f a c e c s n / i o 0 s c k / i o 1 s d o / i o 3 s d i / i o 2 r e f e r e n c e s w i t c h p r o c e s s i n g r e f l 1 r e f r 1 r e f e r e n c e s w i t c h p r o c e s s i n g c o n t r o l l e r 2 s i n g l e w i r e i n t e r f a c e 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p 2 2 n s w i o n s w _ s e l r e f l 2 r e f r 2 s w i o p e n c 1 a / i n t e n c 1 b / p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n g n d p g n d g n d a t s t _ m o d e d i e p a d c o n t r o l l e r 1 f u l l b r i d g e a f u l l b r i d g e b + v m v s s t e p p e r m o t o r # 1 n s o 1 a 1 o 1 a 2 b r 1 a r s 1 b o 1 b 1 o 1 b 2 d r i v e r 1 1 0 0 n b r 1 b r s 1 a f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r # 2 n s o 2 a 1 o 2 a 2 b r 2 a r s 2 b o 2 b 1 o 2 b 2 d r i v e r 2 b r 2 b r s 2 a v s 1 0 0 n + v m 1 0 0 f c p i c p o + v i o * ) f o r a r e l i a b l e s t a r t - u p i t i s e s s e n t i a l t h a t v c c _ i o c o m e s u p t o a m i n i m u m o f 1 . 5 v b e f o r e t h e t m c 5 0 6 2 l e a v e s t h e r e s e t c o n d i t i o n . t h e r e f o r e , t r i n a m i c r e c o m m e n d s u s i n g a f a s t - s t a r t - u p v o l t a g e r e g u l a t o r ( e . g . t s 3 4 8 0 c x 3 3 ) i n a 3 . 3 v e n v i r o n m e n t . v c c _ i o v c p 1 0 0 n c l k _ i n + v m 5 v o u t v s a 4 . 7 v c c o p t i o n a l e x t e r n a l c l o c k 1 2 - 1 6 m h z 1 0 0 n 1 0 0 n t s 3 4 8 0 c x 3 3 * ) 3 . 3 v 5 v
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 13 www.trinamic.com 3.1.1 vcc_io requirements for a reliable start - up it is essential that vcc_io comes up to a minimum of 1.5v before the TMC5062 leaves the reset condition. the reset condition ends earliest 50s after the time when vsa exceeds its undervoltage threshold of typically 4.2v, or when 5vout exceeds its undervoltage threshold of typically 3.5v, whichever comes last. t here are three ways to come up to vcc_io requirements - 5vout can be used directly to supply vcc_io. in this case there are no further requirements. - an external low drop regulator can be used in a 3.3v environment . n ote, that most voltage regulators are not suit able for this application because they show a delayed boot up . the following external regulators are prove n by trinamic: ts3480cx33 this regulator can be used within the full supply voltage range when tied to the motor supply voltage. ld1117 - 3.3 this regu lator can be used to supply vcc_io from 5vout, or from a supply voltage of up to 15v. - vcc_io can be supplied externally as shown in figure 3 . 2 . in this case it is mandatory to connect the schottky diode to the l ogic supply of the external circuitry. please note, that the 2k resistor is not to be used with 5v i/o voltage. figure 3 . 2 external supply of vcc_io (showing optional filtering f or vcc) refer to application note no. 028 supply voltage considerations: vcc_io in tmc50xx designs (www.trinamic.com). here you will find complete information about connecting vcc_io. 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n c p i c p o v c c _ i o 2 r 2 2 2 n + v c c _ i o m s s 1 p 3 1 k 2 k 3 . 3 v , o n l y
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 14 www.trinamic.com 3.2 5 v only supply f igure 3 . 3 5v only operation while the standard application circuit is limited to roughly 5.5 v lower supply voltage, a 5 v only application lets the ic run from a normal 5 v +/ - 5 % supply. in this application, linear regulator dr op must be minimized. therefore, the major 5 v load is removed by supplying vcc directly from the external supply. in order to keep supply ripple away from the analog voltage reference, 5vout should have an own filtering capacity and the 5vout pin does not become bridged to the 5v supply. v c c _ i o t m c 5 0 6 2 s p i i n t e r f a c e c s n / i o 0 s c k / i o 1 s d o / i o 3 s d i / i o 2 r e f e r e n c e s w i t c h p r o c e s s i n g r e f l 1 r e f r 1 r e f e r e n c e s w i t c h p r o c e s s i n g c o n t r o l l e r 2 s i n g l e w i r e i n t e r f a c e 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n s w i o n s w _ s e l c l k _ i n r e f l 2 r e f r 2 s w i o p + 5 v 5 v o u t v s a 4 . 7 + v i o e n c 1 a / i n t e n c 1 b / p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n g n d p g n d g n d a t s t _ m o d e d i e p a d v c c o p t . e x t . c l o c k 1 2 - 1 6 m h z 3 . 3 v o r 5 v i / o v o l t a g e 1 0 0 n 4 7 0 n c o n t r o l l e r 1 f u l l b r i d g e a f u l l b r i d g e b + 5 v v s s t e p p e r m o t o r # 1 n s o 1 a 1 o 1 a 2 b r 1 a r s 1 b o 1 b 1 o 1 b 2 d r i v e r 1 1 0 0 n b r 1 b r s 1 a f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r # 2 n s o 2 a 1 o 2 a 2 b r 2 a r s 2 b o 2 b 1 o 2 b 2 d r i v e r 2 b r 2 b r s 2 a v s 1 0 0 n + 5 v 1 0 0 f c p i c p o + v i o
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 15 www.trinamic.com 3.3 external vcc supply supplying vcc from an external supply is advised, when cooling of the chip is critical, e.g. at high environment temperatures in combination with high supply voltages ( 20 v), as the linear regulator i s a major source of on - chip power dissipation. it must be made sure that the external vcc supply comes up before or synchronously with the 5vout supply, because otherwise the power - up reset event may be missed by the TMC5062 . a diode from 5vout to vcc ensu res this, in case the external voltage regulator is not a low drop type linear regulator. in order to prevent overload of the internal 5v regulator when using this diode, an additional series resistor has been added to vsa. an alternative for reduced po wer dissipation is using a lower supply voltage for vsa, e.g. 6v to 12v. if power dissipation is critical, but no external supply is available, the clock frequency can be reduced as a first step by supplying external 12 mhz clock . f igure 3 . 4 using an external 5v supply to reduce linear regulator power dissipation 3.3.1 internal regulator bridged in case a clean external 5v supply is available, it can be used for complete supply of anal og and digital part ( figure 3 . 5 ). the c ircuit will benefit from a well - regulated supply, e.g. when using a +/ - 1% regulator. a precise supply guarantees increased motor current precision, because the voltage at 5vout directly is th e reference voltage for all internal units of the driver, especially for motor current control. for best performance, the power supply should have low ripple to give a precise and stable supply at 5vout pin with remaining ripple well below 5mv. some switch ing regulators have a higher remaining ripple, or different loads on the supply may cause lower frequency ripple. in this case, increase capacity attached to 5vout. in case the external supply voltage has poor stability or low frequency ripple, this would affect the precision of the motor current regulation as well as add chopper noise. figure 3 . 5 using an external 5v supply to bypass internal regulator the diode is mandatory to satisfy power - up conditions! 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n + 5 v c p i c p o 2 2 0 r l l 4 1 4 8 5 v v o l t a g e r e g u l a t o r + 5 v 5 v o u t v s a 4 . 7 v c c 4 7 0 n 1 0 r w e l l - r e g u l a t e d , s t a b l e s u p p l y , b e t t e r t h a n + - 5 %
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 16 www.trinamic.com 3.4 optimizing analog precisio n the 5vout pin is used as an analog reference for operation of the TMC5062 . performance will degrade when there is voltage ripple on this pin. most of the high frequency ripple in a TMC5062 design results from the operation of the internal digital log ic. the digital logic switches wit h each edge of the clock signal. further, ripple results from operation of the charge pump, which operates with roughly 1 mhz and draws current from the vcc pin. in order to keep this ripple as low as possible, an additional f iltering capacitor can be put directly next to the vcc pin with vias to the gnd plane giving a short connection to the digital gnd pins (pin 6 and pin 34). analog performance is best, when this ripple is kept away from the analog supply pin 5vout, using an additional series resistor of 2.2 ? to 3.3 ? . the voltage drop on this resistor will be roughly 100 mv (i vcc * r). f igure 3 . 6 adding an rc - filter on vcc for reduced ripple 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n c p i c p o g n d a 2 r 2
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 17 www.trinamic.com 3.5 driver protection and eme circuitry s ome applications have to cope with esd events caused by motor operation or external influence. despite esd circuitry within the driver chips, esd events occurring during operation can cause a reset or even a destruction of the motor driver, depending on th eir energy. especially plastic housings and belt drive systems tend to cause esd events. it is best practice to avoid esd events by attaching all conductive parts, especially the motors themselves to pcb ground, or to apply electrically conductive plastic parts. in addition, the driver can be protected up to a certain degree against esd events or live plugging / pulling the motor, which also causes high voltages and high currents into the motor connector terminals. a simple scheme uses capacitors at the dri ver outputs to reduce the dv/dt caused by esd events. larger capacitors will bring more benefit concerning esd suppression, but cause additional current flow in each chopper cycle, and thus increase driver power dissipation, especially at high supply volta ges. the values shown are example values C they might be varied between 100pf and 1nf. the capacitors also dampen high frequency noise injected from digital parts of the circuit and thus reduce electromagnetic emission. a more elaborate scheme uses lc filt ers to de - couple the driver outputs from the motor connector. varistors in between of the coil terminals eliminate coil overvoltage caused by live plugging. optionally protect all outputs by a varistor against esd voltage . fig ure 3 . 7 simple esd enhancement and more elaborate motor output protection f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r n s o a 1 o a 2 o b 1 o b 2 d r i v e r 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r n s o a 1 o a 2 o b 1 o b 2 d r i v e r 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z v 1 v 2 f i t v a r i s t o r s t o s u p p l y v o l t a g e r a t i n g . s m d i n d u c t i v i t i e s c o n d u c t f u l l m o t o r c o i l c u r r e n t . 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v v a r i s t o r s v 1 a n d v 2 p r o t e c t a g a i n s t i n d u c t i v e m o t o r c o i l o v e r v o l t a g e . v 1 a , v 1 b , v 2 a , v 2 b : o p t i o n a l p o s i t i o n f o r v a r i s t o r s i n c a s e o f h e a v y e s d e v e n t s . b r b r s a b r a 1 0 0 n f 1 6 v r s b 1 0 0 n f 1 6 v v 1 a v 1 b v 2 a v 2 b
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 18 www.trinamic.com 4 spi interface 4.1 spi datagram structure the TMC5062 uses 40 bit spi ? (serial peripheral interface, spi is trademark of motorola) datagr ams for communication with a microcontroller. microcontrollers which are equipped with hardware spi are typically able to communicate using integer multiples of 8 bit. the ncs line of the TMC5062 must be handled in a way, that it stays active (low) for the complete duration of the datagram transmission. each datagram sent to the TMC5062 is composed of an address byte followed by four data bytes. this allows direct 32 bit data word communication with the register set of the TMC5062 . each register is accesse d via 32 data bits even if it uses less than 32 data bits. for simplification, each register is specified by a one byte address: - for a read access the most significant bit of the address byte is 0 . - for a write access the most signific ant bit of the addr ess byte is 1 . most registers are write only registers, some can be read additionally, and there are also some read only registers. 4.1.1 selection of write / read (write_notread) the read and write selection is controlled by the msb of the address byte (bit 39 of the spi datagram). this bit is 0 for read access and 1 for write access. so, the bit named w is a write_notread control bit. the active high write bit is the msb of the address byte. so, 0x80 has to be added to the address for a write acces s. the spi interface always delivers data back to the master, independent of the w bit. the data transferred back is the data read from the address which was transmitted with the previous datagram, if the previous access was a read access. if the previous access was a write access, then the data read back mirrors the previously received write data. so, the difference between a read and a write access is that the read access does not transfer data to the addressed register but it transfers the address only a nd its 32 data bits are dummies, and, further the following read or write access delivers back the data read from the address transmitted in the preceding read cycle. a read access request datagram uses dummy write data. read data is transferred back to t he master with the subsequent read or write access. hence, reading multiple registers can be done in a pipelined fashion . whenever data is read from or written to the TMC5062 , the msbs delivered back contain the spi status, spi_status , a number of eight s elected status bits. TMC5062 spi d atagram s tructure msb (transmitted first) 40 bit lsb (transmitted last) 39 ... ... 0 ? 8 bit address ? 8 bit spi status ? ? 32 bit data 39 ... 32 31 ... 0 ? to TMC5062 : rw + 7 bit address ? from TMC5062 : 8 bit spi status 8 bit data 8 bit data 8 bit data 8 bit data 39 / 38 ... 32 31 ... 24 23 ... 16 15 ... 8 7 ... 0 w 38...32 31...28 27...24 23...20 19.. .16 15...12 11...8 7...4 3...0 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 19 www.trinamic.com example : for a read access to the register ( x actual ) with the address 0x2 1, the a ddress byte has to be set to 0x2 1 in the access preceding the read access. for a write access to the register ( v max ), the address byte has to be set to 0x80 + 0x2 7 = 0xa 7 . for read access, the data bit might have any value ( - ). so, one can set them to 0 . action data sent to TMC5062 data received from TMC5062 read x actual ? 0x2100000000 ? 0xss & unused data read x actual ? 0x2100000000 ? 0xss & x actual wr ite v max := 0x00abcdef ? 0xa 7 00abcdef ? 0xss & x actual write v max := 0x00123456 ? 0xa7 00123456 ? 0xss00abcdef *)s: is a placeholder for the status bits spi_status 4.1.2 spi status bits transferred with each d atag ram read b ack new status information becomes latch ed at the end of each access and is available with the next spi transfer. spi_status C status flags transmitted with each spi access in bits 39 to 32 bit name comment 7 - reserved (0) 6 status_stop_l(2) ramp_stat2 [0] C status_stop_l(1) ramp_stat1 [0] C velocity_reached(2) ramp_stat2 [8] C velocity_reached(1) ramp_stat1 [8] C driver_error(2) gstat [2] C gstat ) 1 driver_error(1) gstat [1] C gstat ) 0 reset_flag gstat [ 0 ] C gstat ) 4.1.3 data alignment all data are right aligned. some registers represent unsigned (positive) values, some represent integer values (signed) as twos complement numbers, single bits or groups of bits are represented as single bits respec tively as integer groups. 4.2 spi signals the spi bus on the TMC5062 has four signals: - sck C bus clock input - sdi C serial data input - sdo C serial data output - csn C chip select input (active low) the slave is enabled for an spi transaction by a low on the c hip select input csn. bit transfer is synchronous to the bus clock sck, with the slave latching the data from sdi on the rising edge of sck and driving data to sdo following the falling edge. the most significant bit is sent first. a minimum of 40 sck cloc k cycles is required for a bus transaction with the TMC5062 . if more than 40 clocks are driven, the additional bits shifted into sdi are shifted out on sdo after a 40 - clock delay through an internal shift register. this can be used for daisy chaining mult iple chips. csn must be low during the whole bus transaction. when csn goes high, the contents of the internal shift register are latched into the internal control register and recognized as a command from the master to the slave. if more than 40 bits are sent, only the last 40 bits received before the rising edge of csn are recognized as the command.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 20 www.trinamic.com 4.3 timing the spi interface is synchronized to the internal system clock, which limits the spi bus clock sck to half of the system clock frequency. if the sy stem clock is based on the on - chip oscillator, an additional 10% safety margin must be used to ensure reliable data transmission. all spi inputs as well as the enn input are internally filtered to avoid triggering on pulses shorter than 20ns. f igure 4 . 1 shows the timing parameters of an spi bus transaction, and the table below specifies their values. f igure 4 . 1 spi timing hint usually this spi timing is r eferred to as spi mode 3 (cpol=1 and cpha=1 ). spi interface timing ac - characteristics clock period: t clk parameter symbol conditions min typ max unit sck valid before or after change of csn t cc 10 ns csn high time t csh *) min time is for syn chrono us clk with sck high one t ch before csn high only t clk *) >2t clk +10 ns sck low time t cl *) min time is for syn chronous clk only t clk *) >t clk +10 ns sck high time t ch *) min time is for syn chronous clk only t clk *) >t clk +10 ns sck frequency using inter nal clock f sck assumes minimum osc frequency 4 mhz sck frequency using external 16mhz clock f sck assumes synchronous clk 8 mhz sdi setup time before rising edge of sck t du 10 ns sdi hold time after rising edge of sck t dh 10 ns data out valid time after falling sck clock edge t do no capacitive load on sdo t filt +5 ns sdi, sck and csn filter delay time t filt rising and falling edge 12 20 30 ns c s n s c k s d i s d o t c c t c c t c l t c h b i t 3 9 b i t 3 8 b i t 0 b i t 3 9 b i t 3 8 b i t 0 t d o t z c t d u t d h t c h
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 21 www.trinamic.com 5 uart single wire interface the uart single wire interface allows the control of the TMC5062 with any microcontroller uart. it shares transmit and receive line like an rs485 based interface. data transmission is secured using a cyclic redundancy check, so that increased interface distances (e.g. over cables between two pcbs) can be bridged without the danger of wrong or missed commands even in the event of electro - magnetic disturbance. the automatic baud rate detection make s this interface easy and flexible to use. 5.1 datagram structure 5.1.1 write access TMC5062 uart w rite access datagram structure each byt e is lsbmsb, highest byte transmitted first 0 ... ... 55 sync hronization rw + 7 bit register address 32 bit data crc 07 815 1647 4855 1 0 1 0 0 0 0 0 register address 1 data bytes 3, 2, 1, 0 (high byte to low byte) crc 0 1 2 3 4 5 6 7 8 15 16 47 48 55 a sync nibble precedes each transmission to and from the TMC5062 and is embedded into the first transmitted byte. the second nibble is all zero. e ach transmission allows a synchronization of the internal baud r ate divider to the master cloc k. t he actual baud rate is adapted and variations of the internal clock frequency are compensated . thus, the baud rate can be freely chosen within the valid range. each transmitted byte starts with a start bit (logic 0, low level on swiop) and ends with a stop bit (logic 1, high level on swiop). the bit time is calculated by measuring the time from the beginning of start bit (1 to 0 transition) to the end of the sync frame (1 to 0 transition from bit 2 to bit 3). all data is transmitted byte wise. the 32 bi t data words are transmitted with the highest byte first. a minimum baud rate of 9000 baud is permissible, assuming 20 mhz clock (worst case for low baud rate). maximum baud rate is f clk /16 due to the required stability of the baud clock. the communicat ion becomes reset if a pause time of longer than 63 bit times between the start bits of two successive bytes occurs. this timing is based on the last correctly received datagram. in this case, the transmission needs to be restarted after a failure recovery time of minimum 12 bit times of bus idle time. this scheme allows the master to reset communication in case of transmission errors. any pulse on an idle data line below 16 clock cycles will be treated as a glitch and leads to a timeout of 12 bit times, fo r which the data line must be idle. other errors like wrong crc are also treated the same way. this allows a safe re - synchronization of the transmission after any error conditions. remark, that due to this mechanism, an abrupt reduction of the baud rate to less than 15 percent of the previous value is not possible. each accepted write datagram becomes acknowledged by the receiver by incrementing an internal cyclic datagram counter (8 bit). reading out the datagram counter allows the master to check the suc cess of an initialization sequence or single write accesses. read accesses do not modify the counter.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 22 www.trinamic.com 5.1.2 read access TMC5062 uart r ead access request d atagram structure each byte is lsbmsb, highest byte transmitted first sync hronization rw + 7 bit re gister address crc 0...7 8...15 16...23 1 0 1 0 0 0 0 0 register address 0 crc 0 1 2 3 4 5 6 7 8 15 16 23 the read access request datagram structure is identical to the write access datagram structure, but uses a lower number of user bits. its fun ction is the addressing of the desired register for the read access. the TMC5062 responds with the same baud rate as the master uses for the read request. in order to ensure a clean bus transition from the master to the slave, the TMC5062 does not immedia tely send the reply to a read access, but it uses a programmable delay time after which the first reply byte becomes sent following a read request. this delay time can be set in multiples of eight bit times using senddelay time setting (default=8 bit times ) according to the needs of the master. TMC5062 uart r ead access reply dat agram structure each byte is lsbmsb, highest byte transmitted first 0 ... ... 55 sync hronization r + 7 bit register address 32 bit read data crc 07 815 1647 4855 1 0 1 0 1 1 1 1 register 0 data bytes 3, 2, 1, 0 (high byte to low byte) crc 0 1 2 3 4 5 6 7 8 15 16 47 48 55 the read response is sent to the master. the transmitter becomes switched inactive four bit times after the last bit is sent. e rrata i n r ea d a ccess a known bug in the uart interface implementation affects read access to registers that change during the access. while the spi interface takes a snapshot of the read register before transmission, the uart interface transfers the register directly msb to lsb without taking a snapshot. this may lead to inconsistent data when reading out a register that changes during the transmission. further, the crc sent from the driver may be incorrect in this case (but must not), which will lead to the master rep eating the read access. as a workaround, it is advised not to read out quickly changing registers like x actual , mscnt or x_enc during a motion, but instead first stop the motor or check the position_reached flag to become active, and read out these values afterwards. if possible, use x_latch and enc_latch for a safe readout during motion (e.g. for homing). as the encoder cannot be guaranteed to stand still during motor stop, only a dual read access and check for identical result ensures correct x_enc read d ata . therefore it is advised to use the latching function instead . use the vzero and velocity_reached flag rather than reading v actual .
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 23 www.trinamic.com 5.2 crc calculation an 8 bit crc polynomial is used for checking both read and write access. it allows detection of up to eight single bit errors. the crc8 - atm polynomial with an initial value of zero is applied lsb to msb, including the sync - and register addressing byte. the sync hronization byte is assumed to always be correct. the TMC5062 responds only to correctly transmi tted datagrams . it increases its datagram counter for each correctly received write access datagram. ??? = ? 8 + ? 2 + ? 1 + ? 0 hint: the crc can be calculated within a cpu using a bit - wise cyclic xor calculation of incoming and outgoing bits accu mulated to an 8 bit crc register. you find the algorithm in the TMC5062 - eval evaluation board firmware. crc = (crc << 1) or (crc.7 xor crc.1 xor crc.0 xor [new incoming bit]) -- crc.n is meant to extract bit n from the 8 bit crc register f or a parallel 8 bit calculation of crc in your cpu, you can use a look - up table. additional algorithms can be found in literature.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 24 www.trinamic.com 5.3 uart signals the uart interface on the TMC5062 has two signals: TMC5062 uart i nterface s ignals swiop non - inverted data input and output swion inverted data input and output for use in differential transmission . can be left open in a 5v io voltage system. tie to the half io level voltage for best performance. in uart mode the slave checks the serial wire swiop and swion for correctly re ceived datagrams continuously. both signals are switched as input during this time. it adapts to the baud rate based on the sync nibble, as described before. in case of a read access, it switches on its output drivers on swiop and swion and sends its respo nse using the same baud rate. f igure 5 . 1 connecting to a master via single wire uart interface figure 5 . 2 connecting to a master via differential uart interface m a s t e r c p u ( c w i t h u a r t , s o f t w a r e s w i t c h e s t x d t o h i - z f o r r e c e i v i n g ) t m c 5 0 6 2 s w i o p s w i o n t x d r i d l e + v i o r i d l e f o r c e s s t o p b i t l e v e l i n i d l e c o n d i t i o n s , 3 k 3 i s s u f f i c i e n t r x d m a s t e r c p u ( c w i t h r s 4 8 5 t r a n c e i v e r ) t m c 5 0 6 2 s w i o p s w i o n a b r t e r m 5 0 k + v i o
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 25 www.trinamic.com 6 register mapping this chapter gives an overview of the complete register set. some of the registers bundling a number of single bits are detailed in extra tables. the functional practical appl ication of the settings is detailed in dedicated chapters. note - all registers become reset to 0 upon power up, unless otherwise noted. - add 0x80 to the address addr for write accesses! n otation of hexadecim al and binary number s 0x precedes a hexadec imal number, e.g. 0x04 % precedes a multi - bit binary number, e.g. %100 n otation of r/w field r read only w write only r/w read - and writable register r+c clear upon read o verview r egister m apping r egister d escription general configuration regist ers these registers contain - global configuration - global status flags - slave address configuration - and i/o configuration ramp generator motion control register set this register set offers registers for - choosing a ramp mode - choosing velocities - homing - acce leration and deceleration - target positioning ramp generator driver feature control register set this register set offers registers for - driver current control - setting thresholds for coolstep operation - setting thresholds for different chopper modes - setting thresholds for dcstep operation - reference switch and stallguard2 event configuration - a ramp and reference switch status register encoder register set the encoder register set offers all registers needed for proper abn encoder operation. motor driver regi ster set this register set offers registers for - setting / reading out microstep table and counter - chopper and driver configuration - coolstep and stallguard2 configuration - dcstep configuration, and - reading out stallguard2 values and driver error flags
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 26 www.trinamic.com 6.1 g eneral configuration registers g eneral configuration registers (0 x 000 x 1f) r/w addr n register description / bit names rw 0x00 11 gconf bit gconf C global configuration flags 0 ..2 reserved , set to 0 3 poscmp_enable 0: encoder 1 a and b input s are mapped. 1: position compare pulse (pp) and interrupt output (int) are available, encoder 1 is unused. 4 enc1_refsel 0: n channel 1 mapped depending on interface to swiop (if sw_sel=0) or io0 (if sw_sel=1). 1: n channel 1 mapped to refl1. 5 enc2_enable 0: right reference switches are available. 1: encoder 2 a and b signals are mapped to refr1 and refr2 inputs. 6 enc2_refsel 0: n channel 2 mapped depending on interface to swion (if sw_sel=0) or io1 (if sw_sel=1). 1: n channel 2 map ped to refl2. 7 test_mode 0: normal operation 1: enable analog test output on pin refr2 test_sel selects the function of refr2: 04: t120, dac1, vddh1, dac2, vddh2 attention: not for user, set to 0 for normal operation! 8 shaft1 1: inverse motor 1 direction 9 shaft2 1: inverse motor 2 direction 10 lock_gconf 1: gconf is locked against further write access. r+c 0x01 4 gstat bit gstat C global status flags 0 reset 1: indicates that the ic has been reset since the last re ad access to gstat. 1 drv_err1 1: indicates, that driver 1 has been shut down due to overtemperature or short circuit detection since the last read access. read drv_status1 for details. the flag can only be reset when all error conditions are cleare d. 2 drv_err2 1: indicates, that driver 2 has been shut down due to overtemperature or short circuit detection since the last read access. read drv_status2 for details. the flag can only be reset when all error conditions are cleared. 3 uv_cp 1: indicates an undervoltage on the charge pump. the driver is disabled in this case. r 0x02 8 ifcnt interface transmission counter. this register becomes
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 27 www.trinamic.com g eneral configuration registers (0 x 000 x 1f) r/w addr n register description / bit names incremented with each successful uart interface write access. it can be read out to check the ser ial tr ansmission for lost data. read accesses do not change the content. disabled in spi operation. the counter wraps around from 255 to 0. w 0x03 4 + 4 slave conf bit slaveconf 3..0 test_sel : selects the function of refr2 in test mode : 04: t120, dac1, v attention: not for user, set to 0 for normal operation! 7..4 senddelay : 0, 1: 8 bit times 2, 3: 3*8 bit times 4, 5: 5*8 bit times 6, 7: 7*8 bit times 8, 9: 9*8 bit times 10, 11: 11*8 bit times 12, 13: 13*8 bit times 14, 15: 15*8 b it times r 0x04 8 + 8 input bit input reads the state of all input pins available plus the state of io pins set to output. 0 io0_in : io0 polarity 1 io1_in : io1 polarity 2 io2_in : io2 polarity 3 io3_in : io3 polarity 4 iop_in: iop pin polarity (always input in spi mode) 5 ion_in : ion pin polarity (always input in spi mode) 6 reserved, ignore this bit 7 drv_enn 31.. 24 version : 0x01=first version of the ic identical numbers mean full digital compatibility. w 4 + 4 output bit output sets the io output pin polarity and data direction. 0 io0_out : io0 output polarity 1 io1_out : io1 output polarity 2 io2_out : io2 output polarity 3 io 3 _out : io 3 output polarity 8 ioddr0 : io0 data dir ection : 0=inp ut, 1=output 9 ioddr1 : io1 data direction : 0=input, 1=output 10 ioddr2 : io2 data direction : 0=input, 1=output 11 ioddr3 : io3 data direction: 0=input, 1=output w 0x05 32 x_compare position comparison register for motor 1 positio n strobe. activate poscmp_enable to get position pulse on output pp. xactual = x_compare : - output pp becomes high. it returns to a low state, if the positions mismatch.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 28 www.trinamic.com 6.2 ramp generator registers addresses addr are specified for motor 1 (upper value) a nd motor 2 (second address). 6.2.1 ramp generator motion control register set r amp generator motion control register set (m otor 1: 0 x 200 x 2d, m otor 2: 0 x 400 x 4d) r/w addr n register description / bit names range [unit] rw 0x20 0x40 2 rampmode rampmode: 0: po sitioning mode (using all a, d and v parameters) 1: velocity mode to positive vmax (using amax acceleration) 2: velocity mode to negative vmax (using amax acceleration) 3: hold mode (velocity remains unchanged, unless stop event occurs) 03 rw 0x21 0x41 3 2 xactual actual motor position (signed) hint: this value normally should only be modified, when homing the drive. in positioning mode, modifying the register content will start a motion. - 2^31 +(2^31) - 1 r 0x22 0x42 24 vactual actual motor velocity from ramp generator (signed) the sign matches the motion direction. a negative sign means motion to lower xactual. + - (2^23) - 1 [steps / t] w 0x23 0x43 18 vstart motor start velocity (unsigned) set vstop vstart! 0(2^18) - 1 [steps / t] w 0x24 0x44 16 a1 first acceleration between vstart and v1 (unsigned) 0(2^16) - 1 [steps / ta2] w 0x25 0x45 20 v1 first acceleration / deceleration phase target velocity (unsigned) 0: disables a1 and d1 phase, use amax , d max only 0(2^20) - 1 [steps / t] w 0x26 0x46 16 am ax second acceleration between v1 and vmax (unsigned) this is the acceleration and deceleration value for velocity mode. 0(2^16) - 1 [steps / ta2] w 0x27 0x47 23 vmax motion ramp target velocity (for positioning ensure vmax vstart ) (unsigned) this is the target velocity in velocity mode. it can be changed any time during a motion. 0(2^23) - 512 [steps / t] w 0x28 0x48 16 dmax deceleration between vmax and v1 (unsigned) 0(2^16) - 1 [steps / ta2] w 0x2a 0x4a 16 d1 decelera tion between v1 and vstop (unsigned) attention: do not set 0 in positioning mode, even if v1=0! 1(2^16) - 1 [steps / ta2]
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 29 www.trinamic.com r amp generator motion control register set (m otor 1: 0 x 200 x 2d, m otor 2: 0 x 400 x 4d) r/w addr n register description / bit names range [unit] w 0x2b 0x4b 18 vstop motor stop velocity (unsigned) attention: set vstop vstart! attention: do not set 0 in positioning mode . 1 (2^18) tzerowait waiting time after ramping down to zero velocity before next movement or direction inversion can start and before motor power down starts. time range is about 0 to 2 seconds. this setting avoids excess acce leration e.g. from vstop to - vstart . 0(2^16) clk rw 0x2d 0x4d 32 xtarget target position for ramp mode (signed). write a new target position to this register in order to activate the ramp generator positioning in rampmode =0. initialize all veloc ity, acceleration and deceleration parameters before. hint: the position is allowed to wrap around, thus, xtarget value optionally can be treated as an unsigned number. hint: the maximum possible displacement is +/ - ((2^31) - 1). hint: when increasing v1, d1 or dmax during a motion, rewrite xtarget afterwards in order to trigger a second acceleration phase, if desired. - 2^31
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 30 www.trinamic.com 6.2.2 ramp generator driver feature control register set r amp generator driver feature control regi ster set (m otor 1: 0 x 300 x 36, m otor 2: 0 x 500 x 56) r/w addr n register description / bit names w 0x30 0x50 5 + 5 + 4 ihold_irun bit ihold_irun C driver current control 4..0 ihold standstill current (0=1/3231=32/32) 12..8 irun motor run current (0=1/3231=32/32) hint: choose sense resistors in a way, that normal irun is 16 to 31 for best microstep performance. 19..16 iholddelay controls the number of clock cycles for motor power down after a motion as soon as t_zerowait has expired. the smooth transition avoids a motor jerk upon power down. 0: instant power down 1.. 15: delay per current reduction step in multiple of 2^18 clocks w 0x31 0x51 23 vcoolthrs this is the lower threshold velocity for switching on smart energy coolstep. (unsigned) set this parameter to disable coolstep at low speeds, where it cannot work reliably. vhigh | vact | vcoolthrs: - coolstep is enabled, if configured (only bits 22..8 are used for value and for comparison) w 0x32 0x52 23 vhigh this velocity setting allows velocity depend e nt switching into a different chopper mode and fullstepping to maximize to rque. (unsigned) | vact | vhigh : - coolstep is disabled (motor runs with normal current scale) - if vhighchm is set, the chopper switches to chm =1 with tfd =0 (constant off time with slow decay, only). - chopsync 2 is switched off ( sync =0) - if vhighfs is set, the motor operates in fullstep mode. (only bits 22..8 are used for value and for comparison)
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 31 www.trinamic.com r amp generator driver feature control regi ster set (m otor 1: 0 x 300 x 36, m otor 2: 0 x 500 x 56) r/w addr n register description / bit names w 0x33 0x53 23 vdcmin automatic commutation dcstep becomes enabled above velocity v dcmin (unsigned) in this mode, the actual position is determined by the sensor - le ss motor commutation and becomes fed back to xactual . in case the motor becomes heavily loaded, vdcmin also is used as the minimum step velocity. 0: disable, dcstep off |vact| vdcmin 256: - triggers the same actions as exceeding vhigh . - switches on automatic commutation dcstep hint: also set bits vhighfs and vhighchm and set dcctrl parameters in order to operate dcstep. (only bits 22 sw_mode switch mode configuration s ee separate table ! r+c 0x35 0x55 14 ramp_stat ramp status and switch event status see separate table! r 0x36 0x56 32 xlatch ramp generator latch position, latches xactual upon a programmable switch event (see sw_mode ). hint: the encoder position can be latched to enc_latch together with xlatch to allow consistency checks. time reference t for velocities: t = 2^24 / f clk time reference ta2 for accelerations: ta2 = 2^41 / (f clk )2
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 32 www.trinamic.com 6.2.2.1 sw_mod e C reference switch and stallguard2 event configuration register 0 x 34, 0 x 54: sw_mode C reference switch and stall g uard 2 event configuration register bit name comment 11 en_softstop 0: hard stop 1: soft stop the soft stop mode always uses the decelerati on ramp settings dmax , v 1 , d1 , vstop and tzerowait for stopping the motor. a stop occurs when the velocity sign matches the reference switch position (refl for negative velocities, refr for positive velocities) and the respective switch stop function is en abled. a hard stop also uses tzerowait before the motor becomes released. attention: do not use soft stop in combination with stallguard2 . 10 sg_stop 1: enable stop by stallguard2 . disable to release motor after stop event. attention: do not enable du ring motor spin - up, wait until the motor velocity exceeds a certain value, where stallguard 2 delivers a stable result. 9 en_latch_encoder 1: latch encoder position to enc_latch upon reference switch event. 8 latch_r_inactive 1: activates latching of the position to xlatch upon an inactive going edge on the right reference switch input refr. the active level is defined by pol_stop_r . 7 latch_r_active 1: activates latching of the position to xlatch upon an active going edge on the right reference switch in put refr. hint: activate latch_r_active to detect any spurious stop event by reading status_latch_r. 6 latch_l_inactive 1: activates latching of the position to xlatch upon an inactive going edge on the left reference switch input refl. the active level is defined by pol_stop_ l. 5 latch_l_active 1: activates latching of the position to xlatch upon an active going edge on the left reference switch input refl. hint: activate latch_l_active to detect any spurious stop event by reading status_latch_l. 4 sw ap_lr 1: swap the left and the right reference switch input 3 pol_stop_r sets the active polarity of the right reference switch input 0=non - inverted, high active: a high level on refr stops the motor 1=inverted, low active: a low level on refr stops the motor 2 pol_stop_l sets the active polarity of the left reference switch input 0=non - inverted, high active: a high level on refl stops the motor 1=inverted, low active: a low level on refl stops the motor 1 stop_r_enable 1: enables automatic motor stop during active right reference switch input hint: the motor restarts in case the stop switch becomes released. 0 stop_l_enable 1: enables automatic motor stop during active left reference switch input hint: the motor restarts in case the stop switch beco mes released.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 33 www.trinamic.com 6.2.2.2 ramp_stat C ramp and reference switch status register 0 x 35, 0 x 55: ramp_stat C ramp and reference s witch status registe r r/w bit name comment r 13 status_sg 1: signals an active stallguard2 input from the coolstep driver or from the dcst ep unit, if enabled. hint: when polling this flag, stall events may be missed C activate sg_stop to be sure not to miss the stall event. r+c 12 second_move 1: signals that the automatic ramp requires moving back in the opposite direction, e.g. due to on - the - fly parameter change (flag is cleared upon reading) r 11 t_zerowait_ active 1: signals, that t_zerowait is active after a motor stop. during this time, the motor is in standstill. r 10 vzero 1: signals, that the actual velocity is 0. r 9 position_ reached 1: signals, that the target position is reached. this flag becomes set while x actual and x target match. r 8 velocity_ reached 1: signals, that the target velocity is reached. this flag becomes set while vactual and vmax match. r+c 7 event_pos_ reached 1: signals, that the target position has been reached ( pos ition _reached becoming active). flag and interrupt condition are cleared upon reading) this bit is ored to the interrupt output signal. r+c 6 event_stop_ sg 1: signals an active stallguard2 stop event. reading the register will clear the stall condition and the motor may re - start motion, unless the motion controller has been stopped. (flag and interrupt condition are cleared upon reading) this bit is ored to the interrupt output signal. r 5 even t_stop_r 1: signals an active stop right condition due to stop switch. the stop condition and the interrupt condition can be removed by setting ramp_mode to hold mode or by commanding a move to the opposite direction. in soft_stop mode, the condition will remain active until the motor has stopped motion into the direction of the stop switch. disabling the stop switch or the stop function also clears the flag, but the motor will continue motion. this bit is ored to the interrupt output signal. 4 event_sto p_l 1: signals an active stop left condition due to stop switch. the stop condition and the interrupt condition can be removed by setting ramp_mode to hold mode or by commanding a move to the opposite direction. in soft_stop mode, the condition will remain active until the motor has stopped motion into the direction of the stop switch. disabling the stop switch or the stop function also clears the flag, but the motor will continue motion. this bit is ored to the interrupt output signal. r+c 3 status_latch_ r 1: latch right ready (enable position latching using switch_mode settings latch_r_active or latch_r_inactive ) (flag is cleared upon reading) 2 status_latch_l 1: latch left ready (enable position latching using switch_mode settings latch_l_active or latch_l_inactive ) (flag is cleared upon reading) r 1 status_stop_r reference switch right status (1=active) 0 status_stop_l reference switch left status (1=active)
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 34 www.trinamic.com 6.3 encoder registers e ncoder register set (m otor 1: 0 x 380 x 3c, m otor 2: 0 x 580 x 5c) r/ w addr n register description / bit names range [unit] rw 0x38 0x58 11 encmode encoder configuration and use of n channel see separate table! rw 0x39 0x59 32 x_enc actual encoder position (signed) - 2^31 +(2^31) - 1 w 0x3a 0x5a 32 enc_const accumulation constant (signed) 16 bit integer part, 16 bit fractional part x_enc accumulates +/ - enc_const / (2^16* x_enc ) (binary) or +/ - enc_const / (10^4* x_enc ) (decimal) encmode bit enc_sel_decimal switches between decimal and binary setting. use the sign, to matc h rotation direction! binary: [steps/2^16] (0 32767. 9999847 ) decimal: (0 32767.9999) reset default = 1.0 (=65536) r+c 0x3b 0x5b 1 enc_status bit 0: n_event 1: encoder n event detected. status bit is cleared on read: read (r) + clear (c) this bit is ored to the interrupt output signal. r 0x3c 0x5c 32 enc_latch encoder position x_enc latched on n event
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 35 www.trinamic.com 6.2.2.3 encmode C encoder register 0 x 38, 0 x 58: encmode C e ncoder register bit name comment 10 enc_sel_decimal 0 encoder prescaler divisor binary mod e: counts enc_const(fractional part) /65536 1 encoder prescaler divisor decimal mode: counts in enc_const(fractional part) /10000 9 latch_x_act 1: also latch x actual position together with x_enc . allows latching the ramp generator position upon an n channel event as selected by pos_edge and neg_edge . 8 clr_enc_x 0 upon n event, x_enc becomes latched to enc_latch only 1 latch and additionally clear encoder counter x_enc at n - event 7 neg_edge n p n channel event sensitivity 6 pos_edge 0 0 n channe l event is active during an active n event level 0 1 n channel is valid upon active going n event 1 0 n channel is valid upon inactive going n event 1 1 n channel is valid upon active going and inactive going n event 5 clr_once 1: latch or latch and clear x_enc on the next n event following the write access 4 clr_cont 1: always latch or latch and clear x_enc upon an n event (once per revolution, it is recommended to combine this setting with edge sensitive n event) 3 ignore_ab 0 an n event occur s only when polarities given by pol_n , pol_a and pol_b match. 1 ignore a and b polarity for n channel event 2 pol_n defines active polarity of n (0=neg., 1=pos.) 1 pol_b required b polarity for an n channel event (0=neg., 1=pos.) 0 pol_a required a polarity for an n channel event (0=neg., 1=pos.)
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 36 www.trinamic.com 6.4 motor driver registers m otor driver register set (m otor 1: 0 x 600 x 6f, m otor 2: 0 x 700 x 7f) r/w addr n register description / bit names range [unit] w 0x60 0x70 32 mslut1[0] mslut2[0] microstep table en tries 031 each bit gives the difference between microstep x and x+1 when combined with the cor res ponding mslutsel w bits: 0: w = %00: - 1 %01: +0 %10: +1 %11: +2 1: w = %00: +0 %01: +1 %10: +2 %11: +3 this is the differential coding for the first quarter of a wave. start values for cur_a and cur_b are stored for mscnt position 0 in start_sin and start_sin90_120 . ofs31, ofs30, , ofs01, ofs00 ofs255, ofs254, , ofs225, ofs224 32x 0 or 1 reset default= sine wave table w 0x61 0x67 0x71 0x77 7 x 32 mslut1[1...7] mslut2[1...7] microstep table entries 32255 7x 32x 0 or 1 reset default= sine wave table w 0x68 0x78 32 mslutsel1 mslutsel2 this register defines four segments within each quarter mslut wave. four 2 bit entries determine the meanin g of a 0 and a 1 bit in the corresponding segment of mslut . see separate table! 0 < x1 < x2 < x3 reset default= sine wave table w 0x69 0x79 8 + 8 mslutstart bit 7 0: start_sin bit 23 16: start_sin90_120 start_sin gives the absolute current at microstep table entry 0. start_sin 90_120 gives the absolute current for microstep table entry at positions 256 . start values are transferred to the micro step registers cur_a and cur_b , when ever the reference position mscnt =0 is passed. start_sin reset default =0 start_sin90_1 20 reset default =247 r 0x6a 0x7a 10 mscnt microstep counter. indicates actual position in the microstep table for cur_a . cur_b uses an offset of 256 . hint: move to a position where mscnt is zero before re - initializing mslutstart or mslut and mslutsel . r 0x6b 0x7b 9 + 9 mscuract bit 8 0: cur_a (signed): actual microstep current for motor phase a as read from mslut (not scaled by current) bit 24 16: cur_b (signed): actual microstep current for motor phase b as read from mslut (not sc aled by current) rw 0x6c 0x7c 32 chopconf chopper and driver configuration see separate table! w 0x6d 0x7d 25 coolconf coolstep smart current control register and stallguard2 configuration see separate table!
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 37 www.trinamic.com w 0x6e 0x7e 8 + 8 dcctrl dcstep ( dc ) automatic commutation configuration register: bit 7 dc_time : upper pwm on time limit for commutation ( dc_time * 1/f clk ). set slightly above effective blank time tbl . bit 15 dc_sg : max. pwm on time for step loss detection using dcstep stallguard2 i n dcstep mode. ( dc_sg * 16/f clk ) set slightly higher than dc_max /16 0=disable r 0x6f 0x7f 32 drv_ status stallguard2 value and driver error flags see separate table! ????? ( 248 ? ??? ( 2 ? ?? ? ? 1024 + ?? 1024 ) ) ? 1 m ircostep table calcu lation for a sine wa ve equivalent to the power on default : - i :[0 255] is the table index - the amplitude of the wave is 248. the resulting maximum positive value is 247 and th e maximum negative value is - 248. - the round function rounds values from 0.5 to 1.4999 to 1
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 38 www.trinamic.com 6.4.1 mslutsel C look up table segmentation definition 0 x 68, 0 x 78: mslutse l C l ook up table segment ation definition bit name function comment 31 x3 lut segment 3 start the sine wave look up table can be divided into up to four segments using an individual step width control entry wx . the segment borders are selected by x1 , x2 and x3 . segment 0 goes from 0 to x1 - 1. segment 1 goes from x1 to x2 - 1. segment 2 goes from x2 to x3 - 1. segment 3 goes from x3 to 255. for defined response the values shall satisfy: 0< x1 < x2 < x3 30 29 28 27 26 25 24 23 x2 lut s egment 2 start 22 21 20 19 18 17 16 15 x1 lut segment 1 start 14 13 12 11 10 9 8 7 w3 lut width select from ofs(x3) to ofs255 width control bit coding w0 w3 : %00: mslut entry 0, 1 select: - 1, +0 %01: mslut entry 0, 1 select: +0, +1 %10: mslut entry 0, 1 select: +1, +2 %11: mslut entry 0, 1 select: +2, +3 6 5 w2 lut width select from ofs(x2) to ofs(x3 - 1) 4 3 w1 lut width select from ofs(x1) to ofs(x2 - 1) 2 1 w0 lut width select f rom ofs00 to ofs(x1 - 1) 0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 39 www.trinamic.com 6.4.2 chopconf C chopper configuration 0 x 6c, 0 x 7c: chopconf C c hopper c onfiguration bit name function comment 31 - r eserved set to 0 30 diss2g short to gnd protection disable 0: short to gnd protection is on 1: short to gnd p rotection is disabled 29 - r eserved set to 0 28 - r eserved set to 0 27 - r eserved set to 0 26 - r eserved set to 0 25 - r eserved set to 0 24 - r eserved set to 0 23 sync3 sync pwm synchronization clock this register allows synchronization of the chopp er for both phases of a two phase motor in order to avoid the occurrence of a beat, especially at low motor velocities. it is automatically switched off above vhigh. %0000: chopper sync function chopsync off %0001 %1111: synchronization with f sync = f c lk /(sync*64) hint: set toff to a low value, so that the chopper cycle is ended, before the next sync clock pulse occurs. set for the double desired chopper frequency for chm=0, for the desired base chopper frequency for chm=1. 22 sync2 21 sync1 20 s ync0 19 vhighchm high velocity chopper mode this bit enables switching to chm =1 and fd =0, when vhigh is exceeded. this way, a higher velocity can be achieved. can be combined with vhighfs =1. if set, the toff setting automatically becomes doubled during high velocity operation in order to avoid doubling of the chopper frequency. 18 vhighfs high velocity fullstep selection this bit enables switching to fullstep, when vhigh is exceeded. switching takes place only at 45 position. the fullstep target curren t uses the current value from the microstep table at the 45 position. 17 vsense sense resistor voltage based current scaling 0: low sensitivity, high sense resistor voltage 1: high sensitivity, low sense resistor voltage 16 tbl1 tbl blank time select %0 0 %11: set comparator blank time to 16, 24, 36 or 54 clocks hint: %01 or %10 recommended for most applications 15 tbl0 14 chm chopper mode 0 standard mode (spreadcycle) 1 constant off time with fast decay time. fast decay time is also termin ated when the negative nominal current is reached. fast decay is after on time. 13 rndtf random toff time 0 chopper off time is fixed as set by toff 1 random mode, toff is random modulated by d nclk = - 12 +3 clocks. 12 disfdcc fast decay mode chm=1 : disfdcc=1 disables current comparator usage for termi - nation of the fast decay cycle
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 40 www.trinamic.com 11 fd3 tfd [3] chm=1: msb of fast decay time setting tfd 10 hend3 hend hysteresis low value offset sine wave offset chm =0 %0000 %1111: 0, 1, , 12 9 hend2 8 hend1 7 hend0 chm =1 %0000 %1111: 1, 0, 1, , 12 6 hstrt2 hstrt hysteresis start value added to hend chm =0 %000 %111: add 1, 2, , 8 to hysteresis low value hend (1/512 of this setting adds to current setting ) attention: effective hend+hstrt 16. hint : hysteresis decrement is done each 16 clocks 5 hstrt1 4 hstrt0 tfd [2..0] fast decay time setting chm =1 fast decay time setting (msb: fd3 ): %0000 %1111: tfd with nclk = 32* h strt (%0000: slow decay only) 3 toff3 toff off time and driver enable off time setting controls duration of slow decay phase nclk = 12 + 32* toff %0000: driver disable, all bridges off %0001: 1 C tbl %0010 %1111: 2 15 2 toff2 1 toff1 0 toff0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 41 www.trinamic.com 6.4.3 coolconf C smart energy control coolstep and stallguard2 0 x 6d, 0 x 7d: coolconf C s mart e nergy control cool s tep and stall g uard 2 bit name function comment - reserved set to 0 24 sfilt stallguard2 filter enable 0 standard mode, high time resolution for stallguard2 1 filtered mode, stallguard2 signal updated for each four fullsteps only to compensate for motor pole tolerances 23 - reserved set to 0 22 sgt6 stallguard2 threshold value this signed value controls stallguard2 l evel for stall output and sets the optimum measurement range for readout. a lower value gives a higher sensitivity. zero is the starting value working with most motors. - 64 to +63: a higher value makes stallguard2 less sensi tive and requires more torque to indicate a stall. 21 sgt5 20 sgt4 19 sgt3 18 sgt2 17 sgt1 16 sgt0 15 seimin minimum current for smart current control 0: 1/2 of current setting ( irun ) 1: 1/4 of current setting ( irun ) 14 sedn1 current down step speed %00: for each 3 2 stallguard2 values decrease by one %01: for each 8 stallguard2 values decrease by one %10: for each 2 stallguard2 values decrease by one %11: for each stallguard2 value decrease by one 13 sedn0 12 - reserved set to 0 11 semax3 stallguard2 hysteresis value for smart current control if the stallguard2 result is equal to or above ( semin + semax+ 1)*32, the motor current becomes decreased to save energy. %0000 %1111: 0 15 10 semax2 9 semax1 8 semax0 7 - reserved set to 0 6 seup1 current up st ep width current increment steps per measured stallguard2 value %00 %11: 1, 2, 4, 8 5 seup0 4 - reserved set to 0 3 semin3 minimum stallguard2 value for smart current control and smart current enable if the stallguard2 result falls below semin *32, the motor current becomes increased to reduce motor load angle. %0000: smart current control coolstep off %0001 %1111: 1 15 2 semin2 1 semin1 0 semin0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 42 www.trinamic.com 6.4.4 drv_status C stallguard2 value and driver error flags 0 x 6f, 0 x 7f: drv_status C stall g uar d 2 value and driver err or flags bit name function comment 31 stst standstill indicator this flag indicates motor stand still in each operation mode . 30 olb open load indicator phase b 1: open load detected on phase a or b hint: this is just an informat ive flag. the driver takes no action upon it. false detection may occur in fast motion and standstill. check during slow motion or after a motion , only. 29 ola open load indicator phase a 28 s 2gb short to ground indicator phase b 1: short to gnd detecte d on phase a or b. the driver becomes disabled. the flags stay active, until the driver is disabled by software ( toff =0) or by the enn input. 27 s 2ga short to ground indicator phase a 26 otpw overtemperature pre - warning flag 1: overtemperature pre - warni ng threshold is exceeded. the overtemperature pre - warning flag is common for both drivers. 25 ot overtemperature flag 1: overtemperature limit has been reached. drivers become disabled until otpw is also cleared due to cooling down of the ic. the overtemp erature flag is common for both drivers. 24 stallguar d stallguard2 status 1: motor stall detected ( sg_result =0) or dcstep stall in dcstep mode. 23 - reserved ignore these bits 22 21 20 cs actual actual motor current / smart energy current actual current control scaling, for monitoring smart energy current scaling controlled via settings in register coolconf , or for monitoring the function of the automatic current scaling. 19 18 17 16 15 fsactive full step active indicator 1: indi cates that the driver has switched to fullstep as de fi ned by chopper mode settings and velocity thre sholds. 14 - reserved ignore these bits 13 12 11 10 9 sg_ result stallguard2 result respectively pwm on time for coil a in stand still for motor temperature detection mechanical load measurement: the stallguard2 result gives a means to measure mecha nical motor load. a higher value means lower mecha nical load. a value of 0 signals highest load. with opti mum sgt setting, this is an indi cator for a motor stall. the stall detection compares sg_result to 0 in order to detect a stall. sg_result is used as a base for coolstep operation, by comparing it to a pro grammable upper and a lower limit. sg_result is not applicable when dcstep is act ive . stallguard2 works best with microstep operation. temperature measurement: in standstill, no stallguard2 result can be obtained. sg_result shows the chopper on - time for motor coil a instead. if the motor is moved to a determined micro step position at a certain current setting, a comparison of the chopper on - time can help to get a rough estimation of motor temperature. as the motor heats up, its coil resistance rises and the chopper on - time increases. 8 7 6 5 4 3 2 1 0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 43 www.trinamic.com 7 current setting the internal 5 v supply voltage available at the pin 5vout is used as a reference for the coil current regulation based on the sense resistor voltage measurement. the desired maximum motor current is set by selecting an appropriate value for the sense resistor. the sens e resistor voltage range can be selected by the vsense bit in chopconf . the low sensitivity setting (high sense resistor voltage, vsense =0) brings best and most robust current regulation, while high sensitivity (low sense resistor voltage, vsense =1) reduce s power dissipation in the sense resistor. the high sensitivity setting reduces the power dissipation in the sense resistor by nearly half. after choosing the vsense setting and selecting the sense resistor, the currents to both coils are scaled by the 5 - bit current scale parameters ( ihold , irun ). the sense resistor value is chosen so that the maximum desired current (or slightly more) flows at the maximum current setting ( irun = %11111). using the internal sine wave table, which has the amplitude of 248, the rms motor current can be calculated by: ? ??? = ?? + 1 32 ? ? ?? ? ????? + 20 ? ? ? 1 2 the momentary motor current is calculated by: ? ??? = ??? ? / ? 248 ? ?? + 1 32 ? ? ?? ? ????? + 20 ? ? cs is the current scale setting as set by the ihold and irun a nd coolstep. v fs is the full scale voltage as determined by vsense control bit (please refer to electrical characteristics, v srtl and v srth ). cur a/b is the actual value from the internal sine wave table. the internal resistance of 20m? will be increased by external trace resistance, 5m? are realistic. c hoice of r sense and resulting max . motor current r sense [?] rms current [a] (cs=31, vsense=0) rms current [a] (cs=31, vsense=1) 1.00 0.21 0.12 0.82 0.26 0.15 0.75 0.28 0.16 0.68 0.31 0.18 0.50 0.42 0 .24 0.47 0.45 0.25 0.33 0.63 0.35 0.27 0.76 0.43 0.22 0.91 0.51 0.15 1.29*) 0.72 *) value exceeds upper current rating. hint for best precision of current setting, it is advised to measure and fine tune the current in the application.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 44 www.trinamic.com parameter d escription setting comment irun current scale when motor is running. scales coil current values as taken from the internal sine wave table. for high precision motor operation, work with a current scaling factor in the range 16 to 31, because scaling down the current values reduces the effective microstep resolution by making microsteps coarser. this setting also controls the maximum current value set by coolstep. 0 31 1/32, 2/32, 32/32 ihold identical to irun , but for motor in stand still. ihold delay allows smooth current reduction from run current to hold current. iholddelay controls the number of clock cycles for motor power down after t zerowait in increments of 2^18 clocks: 0=instant power down, 1..15: current reduction delay p er current step in multiple of 2^18 clocks. example: when using irun =31 and ihold =16, 15 current steps are required for hold current reduction. a iholddelay setting of 4 thus results in a power down time of 4*15*2^18 clock cycles, i.e. roughly one second at 16mhz. 0 instant ihold 1 15 18 15*2 18 clocks per current decrement vsense allows control of the sense resistor voltage range for full scale current. 0 v fs = 0.32 v 1 v fs = 0.18 v 7.1 sense resistors sense resistors should be carefully selected. the full motor current flows through the sense resistors. they also see the switching spikes from the mosfet bridges. a low - inductance type such as film or composition res istors is required to prevent spikes causing ringing on the sense voltage inputs leading to unstable measurement results. a low - inductance, low - resistance pcb layout is essential. any common gnd path for the two sense resistors must be avoided, because thi s would lead to coupling between the two current sense signals. a massive ground plane is best. please also refer to layout considerations in chapter 20.3 . the sense resistor needs to be able to conduct the peak motor coil cur rent in motor standstill conditions, unless standby power is reduced. under normal conditions, the sense resistor sees a bit less than the coil rms current, because no current flows through the sense resistor during the slow decay phases. the peak sense r esistor power dissipation is: ? ????? = ? ???? 2 ? ? ????? for high current applications, power dissipation is halved by using the low vsense setting and using an adapted resistance value. please be aware, that in this case any voltage drop in pcb traces has a larg er influence on the result. a compact layout with massive ground plane is best to avoid parasitic resistance effects.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 45 www.trinamic.com 8 chopper operation the currents through both motor coils are controlled using choppers. the choppers work independently of each other. i n f igure 8 . 1 the different chopper phases are shown. f igure 8 . 1 chopper phases although the current could be regulated using only on phases and fast dec ay phases, insertion of the slow decay phase is important to reduce electrical losses and current ripple in the motor. the duration of the slow decay phase is specified in a control parameter and sets an upper limit on the chopper frequency. the current co mparator can measure coil current during phases when the current flows through the sense resistor, but not during the slow decay phase, so the slow decay phase is terminated by a timer. the on phase is terminated by the comparator when the current through the coil reaches the target current. the fast decay phase may be terminated by either the comparator or another timer. when the coil current is switched, spikes at the sense resistors occur due to charging and discharging parasitic capacitances. during thi s time, typically one or two microseconds, the current cannot be measured. blanking is the time when the input to the comparator is masked to block these spikes. there are two chopper modes available: a new high - performance chopper algorithm called spreadc ycle and a proven constant off - time chopper mode. the constant off - time mode cycles through three phases: on, fast decay, and slow decay. the spreadcycle mode cycles through four phases: on, slow decay, fast decay, and a second slow decay. the chopper freq uency is an important parameter for a chopped motor driver. a too low frequency might generate audible noise. a high er frequency reduces current ripple in the motor, but with a too high frequency magnetic losses may rise. also power dissipation in the driv er rises with increasing frequency due to the increased influence of switching slopes causing dynamic dissipation. therefore, a compromise needs to be found. most motors are optimally working in a frequency range of 20 khz to 3 0 khz. the chopper frequency is influenced by a number of parameter settings as well as by the motor inductivity and supply voltage. hint a chopper frequency in the range of 16 khz to 3 0 khz gives a good result for most motors. a higher frequency leads to increase d switching losse s . it is advised to check the resulting frequency and to work below 50 khz. r s e n s e i c o i l o n p h a s e : c u r r e n t f l o w s i n d i r e c t i o n o f t a r g e t c u r r e n t r s e n s e i c o i l f a s t d e c a y p h a s e : c u r r e n t f l o w s i n o p p o s i t e d i r e c t i o n o f t a r g e t c u r r e n t r s e n s e i c o i l s l o w d e c a y p h a s e : c u r r e n t r e - c i r c u l a t i o n + v m + v m + v m
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 46 www.trinamic.com three parameters are used for controlling both chopper modes: 8.1 spreadcycle chopper the spreadcycle (pat. fil.) chopper algorithm is a precise and simple to use chopp er mode which automatically determines the optimum length for the fast - decay phase. several parameters are available to optimize the chopper to the application. each chopper cycle is comprised of an on phase, a slow decay phase, a fast decay phase and a s econd slow decay phase (see f igure 8 . 3 ). the two slow decay phases and the two blank times per chopper cycle put an upper limit to the chopper frequency. the slow decay phases typically make up for about 3 0% - 7 0 % of the chopper cyc le in standstill and are important for low motor and driver power dissipation. calculation of a starting value for the slow decay time toff : assumptions: target chopper frequency: 25 khz two slow decay cycles make up for 50 % of overall chopper cycle tim e ? ??? = 1 25 ??? ? 50 100 ? 1 2 = 10 ? for the toff setting this means: ???? = ( ? ??? ? ? ??? ? 12 ) / 32 with 12 mhz clock this gives a setting of toff= 3.4 , i.e. 3 or 4 . with 16 mhz clock this gives a setting of toff= 4.6 , i.e. 4 or 5 . the hysteresis start setting forces the driver to introduce a minimum amount of current ripple into the motor coils. the current ripple must be higher than the current ripple which is caused by resistive losses in the motor in order to give best microstepping results. this will allow the chopper to precisely regulate the current both for rising and for falling target current. the time required to introduce the current ripple into the motor coil also reduces the chopper frequency. therefore, a higher hysteresis setting will lead to a lower chopper frequency. the motor inductance limits the ability of the chopper to follow a changing motor current. further the duration of the on phase and the fast decay must be longer than the blanking time, because the current c omparator is disabled during blanking. it is easiest to find the best setting by starting from a low hysteresis setting (e.g. hstrt =0, hend =0) and increasing hstrt, until the motor runs smoothly at low velocity settings. this can best be checked when mea suring the motor current either with a current probe or by probing the sense resistor voltages (see figure 8 . 2 ). checking the sine wave shape near zero transition will show a small ledge between both half waves in case the hystere sis setting is too small. at medium velocities (i.e. parameter description setting comment toff sets the slow decay time ( off time ). this setting also limits the maximum chopper frequency. setting this parameter to zero completely disables all driver transistors and the motor can free - wheel. 0 chopper off 115 clk = 12 + 32* toff (1 will work with minimum blank time of 24 clocks) tbl selects the comp arator blank time . this time needs to safely cover the switching event and the duration of the ringing on the sense resistor. for most applications, a setting of 1 or 2 is good. for highly capacitive loads, e.g. when filter networks are used, a setting of 2 or 3 will be required. 0 16 t clk 1 24 t clk 2 36 t clk 3 54 t clk chm selection of the chopper mode 0 spreadcycle 1 classic const. off time
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 47 www.trinamic.com 100 to 400 fullsteps per second), a too low hysteresis setting will lead to increased humming and vibration of the motor. figure 8 . 2 n o ledges in curre nt wave with sufficient hysteresis (magenta: current a, yellow & blue: sense resistor voltages a and b) a too high hysteresis setting will lead to reduced chopper frequency and increased chopper noise but will not yield any benefit for the wave shape. qui ck start for a quick start, see the quick configuration guide in chapter 16 . for detail procedure see application note an00 1 - parameterization of spreadcycle as experiments show, the setting is quite independent of the motor, because higher current motors typically also have a lower coil resistance. therefore choosing a low to medium default value for the hysteresis (for example, effective hysteresis = 4) normally fits most applications. the setting can be optimized by experim enting with the motor: a too low setting will result in reduced microstep accuracy, while a too high setting will lead to more chopper noise and motor power dissipation. when measuring the sense resistor voltage in motor standstill at a medium coil current with an oscilloscope, a too low setting shows a fast decay phase not longer than the blanking time. when the fast decay time becomes slightly longer than the blanking time, the setting is optimum. you can reduce the off - time setting, if this is hard to re ach. the hysteresis principle could in some cases lead to the chopper frequency becoming too low, e.g. when the coil resistance is high when compared to the supply voltage. this is avoided by splitting the hysteresis setting into a start setting ( hstrt+he nd ) and an end setting ( hend ). an automatic hysteresis decrementer (hdec) interpolates between both settings, by decrementing the hysteresis value stepwise each 16 system clocks. at the beginning of each chopper cycle, the hysteresis begins with a value wh ich is the sum of the start and the end values ( hstrt + hend ), and decrements during the cycle, until either the chopper cycle ends or the hysteresis end value ( hend ) is reached. this way, the chopper frequency is stabilized at high amplitudes and low supply voltage situations, if the frequency gets too low. this avoids the frequency reaching the audible range.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 48 www.trinamic.com f igure 8 . 3 spreadcycle chopper scheme showing coil current during a chopp er cycle two parameters control spreadcycle mode: parameter description setting comment hstrt hysteresis start setting. this value is an offset from the hysteresis end value hend . 07 hstrt =18 hend hysteresis end setting. sets the hysteresis end value after a number of decrements. the sum hstrt + hend must be 02 3 415 112: positive hend example: in the example a hysteresis of 4 has been chosen. you might decide to not use hysteresis decrement. in this case set: hend =6 (sets an effective end value of 6 - 3=3) hstrt =0 (sets minimum hysteresis, i.e. 1: 3+1=4 ) in order to take advantage of the variable hysteresis, we can set most of the value to the hstrt, i.e. 4, and the remaining 1 to hysteresis end. the resulting configuration register values are as follows: hend = 0 (sets an effective end value of - 3) hstrt =6 (sets an effective start value of hysteresis end +7: 7 - 3=4) hint highest motor velocities sometimes benefit from setting toff to 1 , 2 or 3 and a short tbl of 1 or 0. t i t a r g e t c u r r e n t t a r g e t c u r r e n t - h y s t e r e s i s s t a r t t a r g e t c u r r e n t + h y s t e r e s i s s t a r t o n s d f d s d t a r g e t c u r r e n t + h y s t e r e s i s e n d t a r g e t c u r r e n t - h y s t e r e s i s e n d h d e c
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 49 www.trinamic.com 8.2 classic 2 - phase motor constant off time chopper the classic constant off time chopper is an alternative to spreadcycle. perfectly tuned, it also gives good results. t he classic constant off time chopper (automatically) is used in combination with fullstepping in dcstep operation. the classic c onstant off - time chopper uses a fixed - time fast decay following each on phase. while the duration of the on phase is determined by the chopper comparator, the fast decay time needs to be long enough for the driver to follow the falling slope of the sine wa ve, but it should not be so long that it causes excess motor current ripple and power dissipation. this can be tuned using an oscilloscope or evaluating motor smoothness at different velocities. a good starting value is a fast decay time setting similar to the slow decay time setting. f igure 8 . 4 classic const. off time chopper with offset showing coil current after tuning the fast decay time, the offset should be tuned for a smoot h zero crossing. this is necessary because the fast decay phase makes the absolute value of the motor current lower than the target current (see f igure 8 . 5 ). if the zero offset is too low, the motor stands still for a short moment during current zero crossing. if it is set too high, it makes a larger microstep. typically, a positive offset setting is required for smoothest operation. f igure 8 . 5 zero cross ing with classic chopper and correction using sine wave offset three parameters control constant off - time mode: t i m e a n v a l u e = t a r g e t c u r r e n t t a r g e t c u r r e n t + o f f s e t o n s d f d s d o n f d t i t a r g e t c u r r e n t c o i l c u r r e n t t i t a r g e t c u r r e n t c o i l c u r r e n t c o i l c u r r e n t d o e s n o t h a v e o p t i m u m s h a p e t a r g e t c u r r e n t c o r r e c t e d f o r o p t i m u m s h a p e o f c o i l c u r r e n t
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 50 www.trinamic.com parameter description setting comment tfd ( fd3 & hstrt ) fast decay time setting. with chm=1, these bits control the portion of fast decay for each chopper cycle. 0 slow decay only 115 offset ( hend ) sine wave offset . with chm=1, these bits control the sine wave offset. a positive offset corrects for zero crossing error. 02 3 415 positive offset 112 disfdcc selects usage of the current comparator for termination of the fast decay cycle. if current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actua l positive value. 0 enable comparator termination of fast decay cycle 1 end by time only 8.3 random off time in the constant off - time chopper mode, both coil choppers run freely without synchronization. the frequency of each chopper mainly depends on the coil current and the motor coil inductance. the inductance varies with the microstep position. with some motors, a slightly audible beat can occur between the chopper frequencies when they are close together. this typically occurs at a few microstep posit ions within each quarter wave. this effect is usually not audible when compared to mechanical noise generated by ball bearings, etc. another factor which can cause a similar effect is a poor layout of the sense resistor gnd connections. hint a common fact or, which can cause motor noise, is a bad pcb layout causing coupling of both sense resistor voltages (please refer layouts hint in chapter 20.3 ). to minimize the effect of a beat between both chopper frequenci es, an internal random generator is provided. it modulates the slow decay time setting when switched on by the rndtf bit. the rndtf feature further spreads the chopper spectrum, reducing electromagnetic emission on single frequencies. parameter descriptio n setting comment rndtf this bit switches on a random off time generator, which slightly modulates the off time toff using a random polynomial. 0 disable 1 random modulation enable
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 51 www.trinamic.com 8.4 chopsync2 for quiet motor s while a frequency adaptive chopper like spreadcycle provides excellent high velocity operation, in some applications, a constant frequency chopper is preferred rather than a frequency adaptive chopper. this may be due to chopper noise in motor standstill, or due to electro - magnetic emission. ch opsync provides a means to synchronize the choppers for both coils with a common clock, by extending the off time of the coils. it integrates with both chopper principles. however, a careful set up of the chopper is necessary, because chopsync2 can just in crement the off times, but not reduce the duration of the chopper cycles themselves. therefore, it is necessary to test successful operation best with an oscilloscope. set up the chopper as detailed above, but take care to have chopper frequency higher tha n the chopsync2 frequency. as high motor velocities take advantage of the normal, adaptive chopper style, chopsync2 becomes automatically switched off using the vhigh velocity limit programmed within the motion controller. example: the motor is op erated in spreadcycle mode ( chm =0). the minimum chopper frequency for standstill and slow motion (up to vhigh ) has been determined to be 25 khz under worst case operation conditions (hot motor, low supply voltage). the standstill noise needs to be minimize d by using chopsync. the ic uses an external 16 mhz clock. considering the chopper mode 0, sync has to be set for the closest value resulting in or below the double frequency, e.g. 50 khz. using above formula, a value of 5 results exactly and can be used. trying a value of 6, a frequency of 41.7 khz results, which still gives an effective chopper frequency of slightly above 20 khz, and thus would also be a valid solution. a value of 7 might still be good, but could already give high frequency noise. in cho pper mode 1, sync could be set to any value between 10 and 13 to be within the chopper frequency range of 19.8 khz to 25 khz. parameter description setting comment sync this register allows synchronization of the chopper for both phases of a two phase mo tor in order to avoid the occurrence of a beat, especially at low motor velocities. it is automatically switched off above vhigh . hint: set toff to a low value, so that the chopper cycle is ended, before the next sync clock pulse occurs. set sync for the double desired chopper frequency for chm =0, for the desired base chopper frequency for chm =1. 0 chopsync off 115 clk /64 clk /(15*64) ???? = ? ? ??? 64 ? ? ???? ? a suitable chopsync2 sync value can be calculated as follows:
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 52 www.trinamic.com 9 driver diagnostic flags the TMC5062 drivers supply a complete set of diagnostic and protection capabilities, like short to gnd protection and undervoltage detection. a detection of an open load condition allows testing if a motor coil connection is interrupted. see the drv_status table for details. 9.1 temperature measurement the driver integrates a two level tempe rature sensor (120c pre - warning and 150c thermal shutdown) for diagnostics and for protection of t he ic against excess heat. h eat is mainly generated by the motor driver stages, and, at increased voltage, by the internal voltage regulator. most critical situations, where the driver mosfets could be overheated, are avoided when enabling the short to gnd protection. for many applications, the overtemperature pre - warning will indicate an abnormal operation situation and can be used to initiate user warning o r power reduction measures like motor current reduction. the thermal shutdown is just an emergency measure and temperature rising to the shutdown level should be prevented by design. after triggering the over temperature sensor ( ot flag), the driver remai ns switched off until the system temperature falls below the pre - warning level ( otpw ) to avoid continuous heating to the shut down level. 9.2 short to gnd protection the TMC5062 power stages are protected against a short circuit condition by an additional mea sure - ment of the current flowing through the high - side mosfets. this is important, as most short circuit conditions result from a motor cable insulation defect, e.g. when touching the conducting parts connected to the system ground. the short detection is protected against spurious triggering, e.g. by esd discharges, by retrying three times before switching off the motor. once a short condition is safely detected, the corresponding driver bridge becomes switched off, and the s2g a or s2gb flag becomes set. in order to restart the motor, the user must intervene by disabling and re - enabling the driver. it should be noted, that the short to gnd protection cannot protect the system and the power stages for all possible short events, as a short event is rather u ndefined and a complex network of external components may be involved. therefore, short circuits should basically be avoided. 9.3 open load diagnostics interrupted cables are a common cause for systems failing, e.g. when connectors are not firmly plugged. the TMC5062 detects open load conditions by checking, if it can reach the desired motor coil current. this way, also undervoltage conditions, high motor velocity settings or short and overtemperature conditions may cause triggering of the open load flag, and inform the user, that motor torque may suffer. in motor stand still, open load cannot be measured, as the coils might eventually have zero current. in order to safely detect an interrupted coil connection, read out the open load flags at low or nominal m otor velocity operation, only. however, the ol a and olb flags have just informative character and do not cause any action of the driver.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 5 3 www.trinamic.com 10 ramp generator the ramp generator allows motion based on target position or target velocity. it automatically calcul ates the optimum motion profile taking into account acce leration and velocity settings. the TMC5062 integrates a new type of ramp generator, which offers faster machine operation compared to the classical linear acceleration ramps. the sixpoint ramp genera tor allows adapting the acceleration ramps to the torque curves of a stepper motor and uses two different acceleration settings each for the acceleration phase and for the deceleration phase. see f igure 10 . 2 . 10.1 real world unit conversion the TMC5062 uses its internal or external clock signal as a time reference for all internal operations. thus, all time, velocity and acceleration settings are referenced to f clk . for best stability and reproducibility, it is recommen ded to use an external quartz oscillator as a time base, or to provide a clock signal from a microcontroller. the units of a TMC5062 register content are written as register[ 5062 ]. p arameter vs . u nits parameter / symbol unit calculation / description / comment f clk [hz] [hz] clock frequency of the TMC5062 in [hz] s [s] second us step fs fullstep step velocity v[hz] steps / s v[hz] = v[5 0 62] * ( f clk [hz]/2 / 2^23 ) step acceleration a[hz/s] steps / s^2 a[hz/s] = a[5 0 62] * f clk [hz]^2 / (512*25 6) / 2^24 usc microstep count counts microstep resolution in number of microsteps (i.e. the number of microsteps between two fullsteps C quick s tart for a quick start, see the quick configuration guide in chapter 16 .
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 54 www.trinamic.com 10.2 motion profiles for the ramp generator register set, please refer to the chapter 6.2 . 10.2.1 ramp mode the ramp generator delive rs two phase acceleration and two phase deceleration ramps with additional programmable start and stop velocities (see f igure 10 . 1 ). the two different sets of acceleration and deceleration can be combined fr eely . a common transition speed v1 allows for velocity dependent switching between both acceleration and deceleration settings . a typical use case will use lower acceleration and deceleration values at h igher velocities, as the motors torque declines at higher velocity. when considering friction in the system, it becomes clear, that typically deceleration of the system is quicker than acceleration. thus, deceleration values can be higher in many applications. this way, operation speed of the motor in time critical applic ations can be maximized. as target positions and ramp parameters may be changed any time during the motion, the motion controller will always use the optimum (fastest) way to reach the target, while sticking to the constraints set by the user. this way it might happen, that the motion becomes automatically stopped, crosses zero and drives back again. this case is flagged by the special flag second_move. 10.2.2 start and stop velocity when using increased levels of start - and stop velocity, it becomes clear, that a subsequent move into the opposite direction would provide a jerk identical to vstart + vstop , rather than only vstart . as the motor probably is not able to follow this, you can set a time delay for a subsequent move by setting tzerowait . an active delay t ime is flagged by the flag t_zerowait_active . once the target position is reached, the flag pos ition _reached becomes active. f igure 10 . 1 ramp generator velocity trace showing conseque nt move in negative direction note the start velocity can be set to zero, if n ot used . t he stop v elocity can be set to ten (or down to one), if not used. take care to always set vstop identical to or above vstart . this ensures that even a short motion can be terminated successfully at the target position. v t a c c e l e r a t i o n p h a s e d e c e l e r a t i o n p h a s e m o t o r s t o p v s t o p v s t a r t 0 v 1 v m a x a m a x d m a x d 1 a 1 - a 1 t z e r o w a i t a c c e l e r a t i o n p h a s e v a c t u a l
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 55 www.trinamic.com f igure 10 . 2 illustration of optimized motor torque usage with TMC5062 ramp generator 10.2.3 velocity mode for the ease of use, velocity mode movements do not use the different acceleration and deceleration settings. you need to set vmax and amax only for velocity mode. the ramp generator always uses amax to accelerate or decelerate to vmax in this mode. in order to decelerate the motor to stand still, it is sufficient to set vmax to zero. the flag vzero signals standstill of the motor. the flag velocity_reached always signals, that the target velocity has been reached. please see chapter 10.6 for a known restriction of the ve locity mode. 10.3 interrupt handling the motion controllers provide the capability to issue an interrupt to the microcontroller, e.g. in order to react on a position reached event. in case more than one interrupt source is possible, it is necessary to carefull y check for the actual event, without risking losing an event. i nterrupt handling fo r 2 a xis (e xample for position _ reached ) : 1. read ramp_stat1 to clear the interrupt flags. this will turn off the interrupt source. 2. check xactual1 for reaching of the target position (and any other conditions you want to check for ramp 1). 3. do the same for ramp_stat2 and xactual2 . this way, you are sure that you will not miss any position _reached condition, because you first clear the flags, and afterwards read out the condi tion. 10.4 velocity thresholds the ramp generator provides a number of velocity thresholds coupled to the actual velocity vactual . the different ranges allow programming the motor to the optimum step mode, coil current and acceleration settings. t o r q u e f o r v s t a r t t o r q u e a v a i l a b l e f o r a m a x t o r q u e a v a i l a b l e f o r a c c e l e r a t i o n a 1 t o r q u e r e q u i r e d f o r s t a t i c l o a d s t o r q u e v e l o c i t y [ r p m ] 0 m f r i c t m m a x v m a x m f r i c t p o r t i o n o f t o r q u e r e q u i r e d f o r f r i c t i o n a n d s t a t i c l o a d w i t h i n t h e s y s t e m m m a x m o t o r p u l l - o u t t o r q u e a t v = 0 m o t o r t o r q u e m n o m 2 h i g h a c c e l e r a t i o n r e d u c e d a c c e l . v 1 m n o m 1 m n o m 1 / 2 t o r q u e a v a i l a b l e a t v 1 r e s p . v m a x m o t o r t o r q u e u s e d i n a c c e l e r a t i o n p h a s e h i g h d e c e l e r a t i o n r e d u c e d d e c e l . 2 x m f r i c t o v e r a l l t o r q u e u s a b l e f o r d e c e l e r a t i o n v s t a r t
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 56 www.trinamic.com f igure 10 . 3 ramp generator velocity dependent motor control note since it is not necessary to differentiate the velocity to the last detail, the velocity thresholds use a reduced number of b its for comparison and the lower eight bits of the compare values become ignored. h i g h v e l o c i t y f u l l s t e p m i c r o s t e p + c o o l s t e p m i c r o s t e p + c o o l s t e p m i c r o s t e p p i n g m i c r o s t e p p i n g m o t o r s t a n d s t i l l m o t o r g o i n g t o s t a n d b y m o t o r i n s t a n d b y m o t o r i n s t a n d b y v t v s t o p v s t a r t 0 v 1 v m a x a m a x d m a x d 1 a 1 v a c t u a l v c o o l t h r s v h i g h c u r r e n t t z e r o w a i t r m s c u r r e n t i _ h o l d i _ r u n d i * i h o l d d e l a y c o o l s t e p c u r r e n t r e d u c t i o n
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 57 www.trinamic.com 10.5 reference switches prior to normal operation of the drive an absolute reference position must be set . the reference position can be found using a mechanical stop which can be detected by stall detection, or by a reference switch. in case of a linear drive, the mechanical motion range must not be left. this can be ensured also for abnormal situations by enabling the stop switch functions for the left and the right referenc e switch. therefore, the ramp generator responds to a number of stop events as configured in the sw_mode register. there are two ways to stop the motor: - it can be stopped abruptly, when a switch is hit. this is useful in an emergency case and for stallguar d based homing. - or the motor can be softly decelerated to zero using deceleration settings ( dmax , v1 , d1 ) . hint latching of the ramp position xactual to the holding register xlatch upon a switch event gives a precise snapshot of the position of the refer ence switch. f igure 10 . 4 using reference switches (example) normally o pen or normally closed switches can be used by programming the switch polarity or selecting the pull - up or p ull - down resistor configuration. a normally closed switch is failsafe with respect to an interrupt of the switch connection. switches which can be used are: - mechanical switches, - photo interrupters , or - hall sensors. be careful to select reference switch resistors matching you r switch requirements! in case of long cables additional rc filtering might be required near the TMC5062 reference inputs. adding an rc filter will also reduce the danger of destroying the logic level inputs by wiring faults, but it will add a certain delay which should be considered with respect to the application. i mplementing a h oming p rocedure 1. make sure, that the home switch is not pressed, e.g. by moving away from the switch. 2. activate position latching upon the desired switc h event and activate motor (soft) stop upon active switch. stallguard based homing requires using a hard stop ( en_softstop =0). 3. start a motion ramp into the direction of the switch. (move to a more negative position for a left switch, to a more positive pos ition for a right switch). you may timeout this motion by using a position ramping command. 4. as soon as the switch is hit, the position becomes latched and the motor is stopped. wait until the motor is in standstill again by polling the actual velocity v act ual or checking vzero or the standstill flag. please be aware that reading ramp_stat may clear flags (e.g. sg_stop ) and thus the motor may restart after expiration of tzerowait . in case the stop condition might be reset + v c c _ i o r e f _ l t r a v e l e r m o t o r + v c c _ i o r e f _ r n e g a t i v e d i r e c t i o n p o s i t i v e d i r e c t i o n 1 0 k 1 0 k 2 2 k 1 n f o p t i o n a l r c f i l t e r ( e x a m p l e )
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 58 www.trinamic.com by the read and clear (r+c) function , be sure to execute step 5 within the time range set by tzerowait . 5. switch the ramp generator to hold mode and calculate the difference between the latched position and the actual position. for stallguard based homing or when using hard stop, xactual stops exactly at the home position, so there is no difference (0). 6. write the calculated difference into the actual position register. now, homing is finished. a move to position 0 will bring back the motor exactly to the switching point. in case stallguard was used for homing, a read access to ramp_stat clears the stallguard stop event event_stop_sg and releases the motor from the stop condition. 10.6 restrictions of ramp generator (errata) when the tmc5 062 becomes stopped in velocity mode, there is an irregularity of the position counter failing and counting continuously with clock frequency until the next move is commanded. failure condition: 1. motor is moving in velocity mode 2. master sets vmax =0 to stop the motion 3. upon reaching of vactual =0, the position counter m ay start counting with clock frequency (the deterministically probability for this behavior occurring is about 1/16 million.) in this situation the motor is correctly in standstill and also the ramp state reports the motor to be stopped. when starting the motor again, the position counter continues from the new (wrong) position. this behavior leads to a loss of the synchronization between the position counter and the motor position. background: the restriction is caused by a failure state, which involves the state of the internal velocity pulse generator and the actual point of time, when the velocity becomes zero. when the velocity vactual becomes decreased from one to zero with the 24 bit ramp generator register in a certain state, the xactual position counter gets to a state where it counts up despite the velocity now being zero. this can occur in velocity mode only, because in this mode the internal change of the velocity register is not coupled to an advance in the actual position. the statistical pro bability for the occurrence of the failure is given by the combination of 2^24 (i.e. 16m) possible states of the accumulation register, with one of the states leading to a fail. if the one state of the accumulation register, which leads to an overflow of t he register in case of an accumulation of the last velocity value (1) before reaching zero occurs at exactly the same moment where the velocity actually goes to zero, the xactual counter gets caught in an endless loop. 10.6.1 velocity mode workaround there are two alternatives for a workaround. the first workaround is recommended for most applications which require the use of velocity mode. therefore the application software must allow polling a register on a deterministic, regular time interval. the second work around has less real time relevance, as it just requires a read - modify - write instruction to execute within limited time. first software workaround for applications using velocity mode intensively the velocity mode can be used, but in order to stop the moto r, do not directly set vmax =0. workaround for stopping the motor: 1. set vmax to a low velocity, in the range 1 to 2000 (e.g. 100). even if vmax has been lower before, this ensures a quick termination of the stop procedure. exit the stop procedure, in cas e vmax already had been set to 0 before (motor is stopped). 2. check the velocity_reached flag to become active. alternatively, check if the absolute value of vactual is at or below the value selected for step 1. 3. poll xactual until a new step has been execute d (i.e. xactual has changed) (with vmax =100 this will need at maximum about 10ms, with vmax =1000, about 1ms) (*)
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 59 www.trinamic.com 4. set amax to 65535 (0xffff) and set vmax to zero to finally stop the motor. this will stop the motor within a few microseconds. 5. wait until the motor is actually stopped ( vzero flag active) before starting a new motion. remember to set amax back to the original value before starting the next motion. step (3.) and (4.) are time critical: make sure that the delay between detection of the step exe cution by reading xactual and setting vmax =0 is significantly lower than the time between each two steps. no additional step shall be executed between (3.) and (4.). for example, when xactual can be checked once each 5ms, use a step frequency of max. 100hz (10ms) for vmax in step (1.). you can test the procedure by checking that no further position change has been executed until step 5. do not switch between rampmode 1 and 2 (velocity in positive direction and velocity in negative direction), without stopp ing the motion as described above before changing the direction. second software workaround avoiding velocity mode operate the device in positioning mode instead of velocity mode. use a target position far away to simulate a velocity mode movement, e.g. xtarget := xactual +2^30 to yield a positive motion direction, or xtarget := xactual - 2^30 for a negative direction. a smaller increment down to the span of the deceleration ramp also can be used, depending on how often the procedure is called. the target posit ion this way can be increased in regular intervals in order to have an infinite running (even longer than the 32 bit position range). in order to stop the motor, cease incrementing xtarget . the motor will continue turning and decelerate in time to stop as commanded by the last increment. in order to stop the motor at the next possible position: 1. set vmax to a low velocity, in the range of minimum equal to vstop or up to about 1000 (e.g. 100). depending on the speed of execution of step 4 (mostly limited b y communication between mcu and tmc), higher values can be chosen to speed up the motor stop process. 2. check the velocity_reached flag to become active. in case the position _reached flag becomes active, exit the procedure as the motion has finished normally . 3. read out xactual. for a motion in positive direction, increase it by 2 (or more, e.g. 10 or 100, if desired), and write it to xtarget , for a motion in negative direction, decrease it accordingly. increase vstop to the same value which was selected for vm ax in step 1. this will stop the motor within two steps (or 10, or 100) of the write access to xtarget . (with vmax =100 this will need at maximum about 10 - 20ms, with vmax =1000, about 1 - 2ms) 4. wait until the motor is actually stopped ( vzero flag active) before starting a new motion. remember to set vstop and vmax back to the original values before starting the next positioning move. the read - modify - write access in step (3.) is time critical: make sure that the delay between reading xactual and writing to xtarg et and vstop is significantly lower than the time required doing the remaining 2 steps (or more, as decided for the increment in step (3.)). otherwise the motor might reverse before stopping). with vstop =10, the remaining motion ramp will need about 200ms (*), with vstop =100 it will need about 20ms. (*) the time delays given relate to a clock frequency of about 16mhz. at 12mhz they are 25% longer.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 60 www.trinamic.com optional detection and correction this option risks the occurrence of the error and detects and corrects it . the irregularity of the position counter can easily be detected by reading the counter twice whenever the motor is brought to standstill (vzero flag set). in case, two subsequent read accesses of xactual show a different result during standstill, the pos ition is lost. trigger a new homing sequence. this solution will work well for applications with a low sequence of motion tasks, which allow doing a new homing sequence. in case only one critical motion command per minute is issued, the mean time to fail ure and automatic correction will be > 10 years. 10.6.2 tzerowait and vstart restriction this restriction applies in case that positioning mode is used with alternation of target - positions on - the - fly, i.e. when a reversal of the motion direction can occur due to a change of the target position, while the motor is moving. in this case, set tzerowait =0. set vstart to minimum 1 (or to a higher value). hint: take care, that vstop is always required to be higher than vstart , i.e. vstop must be minimum 2. 10.6.3 stop swi tch handling restriction in case a stop switch is used for homing in conjunction with the automatic motor stop ( stop_l_enable =1 or stop_r_enable =1), a soft stop shall be used (set en_softstop =1). set the deceleration parameters to the desired value. hint : in any case, a homing requires use of the soft stop, as a hard stop might lead to motor step loss. when reaching the reference switch, use the automatic position latch register in order to have an exact reference of where the stop switch became active. use hard stop only for emergency stop. after a hard stop, initiate a new homing sequence, because position might be lost. hint: there is no restriction of using a hard stop in conjunction with stallguard2 ( sg_stop =1). hard stop should be used with stallgu ard in any case, as a stall event means, that the motor is forced into stop.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 61 www.trinamic.com 11 stallguard2 load measurement stallguard2 provides an accurate measurement of the load on the motor. it can be used for stall detection as well as other uses at loads below those which stall the motor, such as coolstep load - adaptive current reduction. the stallguard2 measurement value changes linearly over a wide range of load, velocity, and current settings, as shown in f igure 11 . 1 . at maximum motor load , the value goes to zero or near to zero. this corresponds to a load angle of 90 between the magnetic field of the coils and magnets in the rotor. this also is the most energy - efficient point of operation for the motor. f igure 11 . 1 function principle of stallguard2 parameter description setting comment sgt this signed value controls the stallguard2 threshold level for stall detection and sets the optimum measurement range for rea dout. a lower value gives a higher sensitivity. zero is the starting value working with most motors. a higher value makes stallguard2 less sensitive and requires more torque to indicate a stall. 0 indifferent value +1 +63 less sensitivity - 1 - 64 hi gher sensitivity sfilt enables the stallguard2 filter for more precision of the measurement. if set, reduces the measurement frequency to one measurement per electrical period of the motor (4 fullsteps). 0 standard mode 1 filtered mode status word des cription range comment sg this is the stallguard2 result . a higher reading indicates less mechanical load. a lower reading indicates a higher load and thus a higher load angle. tune the sgt setting to show a sg reading of roughly 0 to 100 at maximum load before motor stall. 0 1023 0: highest load low value: high load high value: less load attention in order to use stallguard2 and coolstep, the stallguard2 sensitivity should first be tuned using the sgt setting! m o t o r l o a d ( % m a x . t o r q u e ) s t a l l g u a r d 2 r e a d i n g 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0 1 0 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 1 0 0 s t a r t v a l u e d e p e n d s o n m o t o r a n d o p e r a t i n g c o n d i t i o n s m o t o r s t a l l s a b o v e t h i s p o i n t . l o a d a n g l e e x c e e d s 9 0 a n d a v a i l a b l e t o r q u e s i n k s . s t a l l g u a r d v a l u e r e a c h e s z e r o a n d i n d i c a t e s d a n g e r o f s t a l l . t h i s p o i n t i s s e t b y s t a l l g u a r d t h r e s h o l d v a l u e s g t .
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 62 www.trinamic.com 11.1 tuning the stallguard2 threshold sgt the stallguard2 value sg is affected by motor - specific characteristics and application - specific demands on load and velocity. therefore the easiest way to tune the stallguard2 threshold sgt for a specific motor type and operating conditions is interactive tun ing in the actual application. i nitial procedure for tuning stall g uard sgt 1. operate the motor at the normal operation velocity for your application and monitor sg . 2. apply slowly increasing mechanical load to the motor. if the motor stalls before sg reaches zero, decrease sgt . if sg reaches zero before the motor stalls, increase sgt . a good sgt starting value is zero. sgt is signed, so it can have negative or positive values. 3. now enable sg_stop and make sure, that the motor is safely stopped whenever it is st alled. increase sgt if the motor becomes stopped before a stall occurs. restart the motor by disabling sg_stop or by reading the ramp_stat register (read and clear function). 4. the optimum setting is reached when sg is between 0 and roughly 100 at increasing load shortly before the motor stalls, and sg increases by 100 or more without load. sgt in most cases can be tuned for a certain motion velocity or a velocity range. make sure, that the setting works reliable in a certain range (e.g. 80% to 120% of desire d velocity) and also under extreme motor conditions (lowest and highest applicable temperature). o ptional procedure a llowing automatic tu ning of sgt the basic idea behind the sgt setting is a factor, which compensates the stallguard measurement for resisti ve losses inside the motor. at standstill and very low velocities, resistive losses are the main factor for the balance of energy in the motor, because mechanical power is zero or near to zero. this way, sgt can be set to an optimum at near zero velocity. this algorithm is especially useful for tuning sgt within the application to give the best result independent of environment conditions, motor stray, etc. 1. operate the motor at low velocity < 10 rpm (i.e. a few to a few fullsteps per second) and target op eration current and supply voltage. in this velocity range, there is not much dependence of sg on the motor load, because the motor does not generate significant back emf. therefore, mechanical load will not make a big difference on the result. 2. switch on s filt . now increase sgt starting from 0 to a value, where sg starts rising. with a high sgt, sg will rise up to the maximum value. reduce again to the highest value, where sg stays at 0. now the sgt value is set as sensibly as possible. when you see sg i ncreasing at higher velocities, there will be useful stall detection. the upper velocity for the stall detection with this setting is determined by the velocity, where the motor back emf approaches the supply voltage and the motor current starts dropping when further increasing velocity. sg goes to zero when the motor stalls and the ramp generator can be programmed to stop the motor upon a stall event by enabling sg_stop in sw_mode . monitor vactual to exceed the lower velocity threshold where stallguard delivers a good result and enable sg_stop during this time only. the system clock frequency affects sg . an external crystal - stabilized clock should be used for applications that demand the highest performance. the power supply voltage also affects sg , so tighter regulation results in more accurate values. sg measurement has a high resolution, and there are a few ways to enhance its accuracy, as described in the following sections. quick start for a quick start, see the quick configuration guide in chapter 16 . for detail procedure see application note an002 - parameterization of stallguard2 & coolstep
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 63 www.trinamic.com 11.1.1 variable velocity operation the sgt setting chosen as a result of the previously described sgt tuning can be used for a certai n velocity range. outside this range, a stall may not be detected safely, and coolstep might not give the optimum result. f igure 11 . 2 example: optimum sgt setting and stallguard2 reading with an example motor in many applications, operation at or near a single operation point is used most of the time and a single setting is sufficient. the ramp generator provides a lower and an upper velocity threshold to match this. the stall det ection should be ignored and disabled by software outside the determined operation point, e.g. during acceleration phases preceding a sensorless homing procedure. in some applications, a velocity dependent tuning of the sgt value can be expedient, using a small number of support points and linear interpolation. 11.1.2 small motors with high torque ripple and resonance motors with a high detent torque show an increased variation of the stallguard2 measurement value sg with varying motor currents, especially at l ow currents. for these motors, the current dependency should be checked for best result. 11.1.3 temperature dependence of motor coil resistance motors working over a wide temperature range may require temperature correction, because motor coil resistance increa ses with rising temperature. this can be corrected as a linear reduction of sg at increasing temperature, as motor efficiency is reduced. 11.1.4 accuracy and reproducibility of stallguard2 measurement in a production environment, it may be desirable to use a fix ed sgt value within an application for one motor type. most of the unit - to - unit variation in stallguard2 measurements results from manu - facturing tolerances in motor construction. the measurement error of stallguard2 C provided that all other parameters re main stable C can be as low as: ?????????? ??????????? ????? = ??? ( 1 , | ??? | ) b a c k e m f r e a c h e s s u p p l y v o l t a g e o p t i m u m s g t s e t t i n g m o t o r r p m ( 2 0 0 f s m o t o r ) s t a l l g u a r d 2 r e a d i n g a t n o l o a d 2 4 6 8 1 0 1 2 1 4 1 6 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0 1 0 0 0 1 8 2 0 0 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 4 0 0 4 5 0 5 0 0 5 5 0 6 0 0 l o w e r l i m i t f o r s t a l l d e t e c t i o n g o o d o p e r a t i o n r a n g e w i t h s i n g l e s g t s e t t i n g
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 64 www.trinamic.com 11.2 stallguard2 update rate and filter the stallguard2 measurement value sg is updated with each full step of the motor. this is enough to safely detect a stall, because a stall alw ays means the loss of four full steps. in a practical application, especially when using coolstep, a more precise measurement might be more important than an update for each fullstep because the mechanical load never changes instantaneously from one step t o the next. for these applications, the sfilt bit enables a filtering function over four load measurements . the filter should always be enabled when high - precision measurement is required. it compensates for variations in motor construction, for example du e to misalignment of the phase a to phase b magnets. the filter should be disabled when rapid response to increasing load is required and for best results of sensorless homing using stallguard . 11.3 detecting a motor stall for best stall detection, work withou t stallguard filtering ( sfilt =0). to safely detect a motor stall the stall threshold must be determined using a specific sgt setting. therefore, the maximum load needs to be determined, which the motor can drive without stalling . at the same time, monitor the sg value at this load, e.g. some value within the range 0 to 100. the stall threshold should be a value safely within the operating limits, to allow for parameter stray. the response at an sgt setting at or near 0 gives some idea on the quality of the signal: check the sg value without load and with maximum load. they should show a difference of at least 100 or a few 100, which shall be large compared to the offset. if you set the sgt value in a way, that a reading of 0 occurs at maximum motor load, the stall can be automatically detected by the motion controller to issue a motor stop. in the moment of the step resulting in a step loss, the lowest reading will be visible. after the step loss, the motor will vibrate and show a higher sg reading. 11.4 homing wi th stallguard the homing of a linear drive requires moving the motor into the direction of a hard stop. as stallguard needs a certain velocity to work, make sure that the start point is far enough away from the hard stop to provide the distance required fo r the acceleration phase. after setting up sgt and the ramp generator registers, start a motion into the direction of the hard stop and activate the stop on stall function as soon as the target velocity has been reached (set sg_stop in sw_mode ). once a sta ll is detected, the ramp generator stops motion and sets v actual zero, stopping the motor. the stop condition also is indicated by the flag stallguard in drv_status . after setting up new motion parameters in order to prevent the motor from restarting right away, stallguard can be disabled, or the motor can be re - enabled by reading ramp_stat . the read and clear function of the event_stop_sg flag in ramp_stat would restart the motor after t zerowait in case the motion parameters have not been modified. 11.5 limits of stallguard2 operation stallguard2 does not operate reliably at extreme motor velocities: very low motor velocities (for many motors, less than one revolution per second) generate a low back emf and make the measurement unstable and dependent on environ ment conditions (temperature, etc.). the automatic tuning procedure described above will compensate for this. other conditions will also lead to extreme settings of sgt and poor response of the measurement value sg to the motor load. very high motor veloc ities, in which the full sinusoidal current is not driven into the motor coils also leads to poor response. these velocities are typically characterized by the motor back emf reaching the supply voltage.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 65 www.trinamic.com 12 coolstep operation coolstep is an automatic smart e nergy optimization for stepper motors based on the motor mechanical load, making them green. 12.1 user benefits coolstep allows substantial energy savings, especially for motors which see varying loads or operate at a high duty cycle. because a stepper motor application needs to work with a torque reserve of 30% to 50%, even a constant - load application allows significant energy savings because coolstep automatically enables torque reserve when required. reducing power consumption keeps the system cooler, increases motor life, and allows reducing cost in the po wer supply and cooling components. reducing motor current by half results in reducing power by a factor of four. 12.2 setting up for coolstep coolstep is controlled by several parameters, but two are critical for understanding how it works: parameter de scription range comment semin 4 - bit unsigned integer that sets a lower threshold . if sg goes below this threshold, coolstep increases the current to both coils. the 4 - bit semin value is scaled by 32 to cover the lower half of the range of the 10 - bit sg va lue. (the name of this parameter is derived from smartenergy, which is an earlier name for coolstep.) 0 disable coolstep 115 semin *32 semax 4 - bit unsigned integer that controls an upper threshold . if sg is sampled equal to or above this t hreshold enough times, coolstep decreases the current to both coils. the upper threshold is ( semin + semax + 1)*32. 015 semin + semax +1)*32 f igure 12 . 1 shows t he operating regions of coolstep : - the black line represents the sg measurement value. - t he blue line represents the mecha nical load applied to the motor. - the red line represents the current into the motor coils. when the load increases, sg falls below semin , and coolstep increases the curre nt. when the load decreases, sg rises above ( semin + semax + 1) * 32, and the current is reduced. energy efficiency C motor generates less heat C less cooling infrastructure C cheaper motor C
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 66 www.trinamic.com f igure 12 . 1 coolstep adapts motor current to the load five more parameters contr ol coolstep and one status value is returned: parameter description range comment seup sets the current increment step . the current becomes incremented for each measured stallguard2 value below the lower threshold. 03 sedn set s the number of stallguard 2 readings above the upper threshold necessary for each current decrement of the motor current. 03 seimin sets the lower motor current limit for coolstep operation by scaling the irun current setting. 0 0: 1/2 of irun 1 1: 1/4 of irun vcool thrs lower ramp generator velocity threshold. below this vel ocity coolstep becomes disabled. adapt to the lower limit of the velocity range where stallguard2 gives a stable re sult. hint: may be adapted to disable coolstep during acceleration and deceleration phase by setting identical to vmax . 1 vhigh upper ramp generator velocity threshold value. above this velocity coolstep becomes disabled. adapt to the velocity ra nge where stallguard2 gives a stable result. 1 status word description range comment csactual this status value provides the actual motor current scale as controlled by coolstep. th e value goes up to the irun value and down to the portion of irun as specified by seimin . 031 1/32, 2/32, 32/32 s t a l l g u a r d 2 r e a d i n g 0 = m a x i m u m l o a d m o t o r c u r r e n t i n c r e m e n t a r e a m o t o r c u r r e n t r e d u c t i o n a r e a s t a l l p o s s i b l e s e m i n s e m a x + s e m i n + 1 z e i t m o t o r c u r r e n t c u r r e n t s e t t i n g i _ r u n ( u p p e r l i m i t ) ? o r ? i _ r u n ( l o w e r l i m i t ) m e c h a n i c a l l o a d c u r r e n t i n c r e m e n t d u e t o i n c r e a s e d l o a d s l o w c u r r e n t r e d u c t i o n d u e t o r e d u c e d m o t o r l o a d l o a d a n g l e o p t i m i z e d l o a d a n g l e o p t i m i z e d l o a d a n g l e o p t i m i z e d
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 67 www.trinamic.com 12.3 tuning coolstep before tuning coolstep, first tune the stallguard2 threshold level sgt , which affects the range of the load measurement v alue sg . coolstep uses sg to operate the motor near the optimum load angle of +90. the current increment speed is specified in seup , and the current decrement speed is specified in sedn . they can be tuned separately because they are triggered by differen t events that may need different responses. the encodings for these parameters allow the coil currents to be increased much more quickly than decreased, because crossing the lower threshold is a more serious event that may require a faster response. if the response is too slow, the motor may stall. in contrast, a slow response to crossing the upper threshold does not risk anything more serious than missing an opportunity to save power. coolstep operates between limits controlled by the current scale parame ter irun and the seimin bit. 12.3.1 response time for fast response to increasing motor load, use a high current increment step seup . if the motor load changes slowly, a lower current increment step can be used to avoid motor oscillations. if the filter controll ed by sfilt is enabled, the measurement rate and regulation speed are cut by a factor of four. hint the most common and most beneficial use is to adapt coolstep for operation at the typical system target operation velocity and to set the velocity threshol ds according. as acceleration and decelerations normally shall be quick, they will require the full motor current, while they have only a small contribution to overall power consumption due to their short duration. 12.3.2 low velocity and s tandby o peration becau se coolstep is not able to measure the motor load in standstill and at very low rpm, a lower velocity threshold is provided in the ramp generator. it should be set to an application specific default value. below this threshold the normal current setting vi a irun respectively ihold is valid. an upper threshold is provided by the vhigh setting. both thresholds can be set as a result of the stallguard2 tuning process.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 68 www.trinamic.com 13 dcstep dcstep is an automatic commutation mode for the stepper motor. it allows the steppe r to run with its target velocity as commanded by the ramp generator as long as it can cope with the load. in case the motor becomes overloaded, it slows down to a velocity, where the motor can still drive the load. this way, the stepper motor never stalls and can drive heavy loads as fast as possible. its higher torque available at lower velocity, plus dynamic torque from its flywheel mass allow compensating for mechanical torque peaks. in case the motor becomes completely blocked, the stall flag becomes s et. 13.1 user benefits 13.2 designing - in dcstep in a classical application, the operation area is limited by the maximum torque required at maximum application velocity. a safety margin of up to 50% torque is required, in order to compensate for unforeseen load peaks, torque loss due to resonance and aging of mechanic al components. dcstep allows using up to the full available motor torque. even higher short time dynamic loads can be overcome using motor and application flywheel mass without the danger of a motor stall. with dcstep the nominal application load can be ex tended to a higher torque only limited by the safety margin near the holding torque area (which is the highest torque the motor can provide). additionally, maximum application velocity can be increased up to the actually reachable motor velocity. f igure 13 . 1 dcstep extended application operation area quick start for a quick start, see the quick configuration guide in chapter 16 . for detail configurati on procedure see application note an003 - dcstep motor C never loses steps application C works as fast as possible acceleration C automatically as high as possible energy efficiency C highest at speed limit cheaper motor C does the job! c l a s s i c o p e r a t i o n a r e a w i t h s a f e t y m a r g i n t o r q u e v e l o c i t y [ r p m ] d c s t e p o p e r a t i o n - n o s t e p l o s s c a n o c c u r a d d i t i o n a l f l y w h e e l m a s s t o r q u e r e s e r v e m i c r o s t e p o p e r a t i o n 0 m n o m 1 m m a x v d c m i n v m a x m n o m : n o m i n a l t o r q u e r e q u i r e d b y a p p l i c a t i o n m m a x : m o t o r p u l l - o u t t o r q u e a t v = 0 a p p l i c a t i o n a r e a m a x . m o t o r t o r q u e s a f e t y m a r g i n d c s t e p e x t e n d e d s a f e t y m a r g i n : c l a s s i c a l a p p l i c a t i o n o p e r a t i o n a r e a i s l i m i t e d b y a c e r t a i n p e r c e n t a g e o f m o t o r p u l l - o u t t o r q u e m n o m 2
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 69 www.trinamic.com 13.3 enabling dcstep dcstep requires only a few settings. it directly feeds back motor motion to the ramp generator, so that it becomes seamlessly integrated into the motion ramp, even if the motor becomes ove rloaded with respect to the target velocity. dcstep operates the motor in fullstep mode at the ramp generator target velocity vactual or at reduced velocity if the motor becomes overloaded. it requires settin g the minimum operation velocity vdcmin . vdcmin shall be set to the lowest operating velocity where dcstep gives a reliable detection of motor operation. the motor never stalls unless it becomes braked to a velocity below vdcmin . in case the velocity should fall below this value, the motor would restart once its load is released, unless the stall detection becomes enabled (set sg_stop ). stall detection is covered by stallguard2 . f igure 13 . 2 velocity profile with impact by overl oad situation attention: dcstep requires that the phase polarity of the sine wave is positive within the mscnt range 768 to 255 and negative within 256 to 767. the cosine polarity must be positive from 0 to 511 and negative from 512 to 1023. a phase shif t by 1 would disturb dcstep operation. therefore it is advised to work with the default wave. please refer chapter 14.2 for an initialization with the default table. 13.4 stall detection in dcstep mode while dcstep is able to dece lerate the motor upon overload, it cannot avoid a stall in every operation situation. once the motor is blocked, or it becomes decelerated below a motor dependent minimum velocity where the motor operation cannot safely be detected any more, the motor may stall and loose steps. in order to safely detect a step loss and avoid restarting of the motor, the stop on stall can be enabled (set flag sg_stop ). in this case v actual becomes set to zero once the motor is stalled. it remains stopped until reading the ra mp_stat status flags. the flag event_stop_sg shows the active stop condition . a stallguard2 load value is not available during dcstep operation. before enabl ing stallguard, make sure that the ramp generator has accelerated the motor to a velocity value vac tual slightly above vdcmin or up to vmax . stall detection in this mode may trigger falsely due to resonances, when flywheel loads are loosely coupled to the motor axis. v t d c s t e p a c t i v e v d c m i n 0 v 1 v m a x a m a x d m a x d 1 a 1 n o m i n a l r a m p p r o f i l e r a m p p r o f i l e w i t h t o r q u e o v e r l o a d a n d s a m e t a r g e t p o s i t i o n o v e r l o a d
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 70 www.trinamic.com parameter description range comment vhighfs & vhighchm these chopper configuration f lags in chopconf need to be set for dcstep operation. as soon as vdcmin becomes exceeded, the chopper becomes switched to fullstepping. 0 / 1 set to 1 for dcstep toff dcstep often benefits from an increased off time value in chopconf . settings >2 should b e preferred. 2 settings 815 do not make vdcmin this is the lower threshold for dcstep operation. below this threshold, the motor operates in normal microstep mode. in dcstep operation, the motor opera tes at minimum vdcmin , even when it is completely blocked. tune together with dc_time setting. 0 2^22 dc_time this setting controls the reference pulse width for dcstep load measuremen t. it must be optimized for robust operation with maximum motor torque. a higher value allows higher torque and higher velocity, a lower value allows operation down to a lower velocity as set by vdcmin . check best setting under nominal operation condition s, and re - check under extreme operating conditions (e.g. lowest operation supply voltage, highest motor temperature, and highest supply voltage, lowest motor temperature). 0 t blank (as defined by tbl ) in clock cycles + 1 dc_sg this se tting controls stall detection in dcstep mode. increase for higher sensitivity. a stall can be used as an error condition by issuing a hard stop for the motor. enable sg_stop flag for stopping the motor upon a stall event. this way the motor will be stopp ed once it stalls. 0 dc_time /16 13.5 measuring actual motor velocity in dcstep operation dcstep has the ability to reduce motor velocity in case the motor becomes slower than the target velocity due to mechanical load. vactual sh ows the ramp generator target velocity. it is not influenced by dcstep. measuring dcstep velocity is possible based on the position counter xactual . therefore take two snapshots of the position counter with a known time difference: ??????? ?????? = ??????? ( ???? 2 ) ? ??????? ( ???? 1 ) ???? 2 ? ???? 1 ? 2 24 ? ??? example: at 16.0 mhz clock frequency, a 0.954 second measurement delay would directly yield in the velocity value, a 9.54 ms delay would yield in 1/100 of the actual dcstep velocity. to grasp the time interval as precisely as possible, snapshot a timer each time the transmission of xactual from the ic starts or ends. the rising edge of ncs for spi transmission provides the most exac t time reference.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 71 www.trinamic.com 14 sine - wave look - up table each of the TMC5062 drivers provides a programmable look - up table for storing the microstep current wave. as a default, the tables are pre - programmed with a sine wave, which is a good starting point for most st epper motors. reprogramming the table to a motor specific wave allows drastically improved microstepping especially with low - cost motors. 14.1 user benefits 14.2 microstep table in order to minimize required memory and the amount of data to be programmed, only a quarter of the wave becomes stored. the internal microstep table maps the microstep wave from 0 to 90 . it becomes symmetr ically extended t o 360 . when reading out the table the 10 - bit microstep counter mscnt addresses the fully extended wave table . the table is stored in an incremental fashion, using each one bit per entry. therefore only 256 bits ( ofs00 to ofs255 ) are required to store the quarter wave. these bits are mapped to eight 32 bit registers. each ofs bit controls the addition of an inclination w x or w x +1 when advancing one step in the table . when wx is 0, a 1 bit in the table at the actual micr ostep position means add one when advancing to the next microstep. as the wave can have a high er inclination than 1, the base inclinations wx can be programmed to - 1, 0, 1, or 2 using up to four flexible programmable segments within the quarter wave. thi s way even negative inclination can be realized. the four inclination segments are controlled by the position registers x 1 to x3 . inclination segment 0 goes from microstep position 0 to x1 - 1 and its base inclination is controlled by w0 , segment 1 goes from x1 to x2 - 1 with its base inclination controlled by w1 , etc. when modifyi ng the wave, care must be taken to ensure a smooth and symmetrical zero transition when the quarter wave becomes expanded to a full wave . the maximum resulting swing of the wave sho uld be adjusted to a range of - 248 to 248 , in order to give the best possible resolution while leaving headroom for the hysteresis based chopper to add an offset. f igure 14 . 1 lu t programming example microstepping C motor C torque C m s c n t y 2 5 6 2 5 6 2 4 8 - 2 4 8 5 1 2 7 6 8 0 0 x 1 x 3 x 2 w 0 : + 2 / + 3 w 1 : + 1 / + 2 w 2 : + 0 / + 1 w 3 : - 1 / + 0 l u t s t o r e s e n t r i e s 0 t o 2 5 5 2 5 5 s t a r t _ s i n s t a r t _ s i n 9 0 _ 1 2 0
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 72 www.trinamic.com when the microstep sequencer advances within the table, it calculates the actual current values for the motor coils with each microstep and stores them to the registers cur_a and cur_b . however the incremental coding requires an abs olute initialization, especially when the microstep table becomes modified. therefore cur_a and cur_b become initialized whenever mscnt passes zero. two registers control the starting values of the tables: - as the starting value at zero is not necessarily 0 (it might be 1 or 2), it can be programmed into the starting point register start_sin . - in the same way, the start of the second wave for the second motor coil needs to be stored in start_sin90_120 . this register stores the resulting table entry for a ph ase shift of 90 for 2 - phase stepper motor s . hint refer chapter 6.4 for the register set and for the default table function stored in the drivers. the default table is a good base for realizing an own table. th e TMC5062 - eval come s with a calculation tool for own waves. initialization e xample for the default microstep table: mslutx[0] = % 101010101010101 01011010101010100 = 0xaaaab554 mslutx[1] = % 010010101001010 10101010010101010 = 0x4a9554aa mslutx[ 2 ] = % 001001000 10010010010100100101001 = 0x24492929 mslutx[ 3 ] = % 00010000000100000100001000100010 = 0x10104222 mslutx[ 4 ] = % 1111101111111 1111111111111111111 = 0xfbffffff mslutx[ 5 ] = % 10110101101110110111011101111101 = 0xb5bb777d mslutx[ 6 ] = % 01001001001010010101010101010110 = 0x49295556 mslutx[ 7 ] = % 00000000010000000100001000100010 = 0x 00 404222 mslutselx = 0xffff8056: x1 = 128 , x2 =255 , x3 = 255 w3 =%01, w2 =%01, w1 =%01, w0 =%10 mslutstartx = 0x00 f 70000 : start_sin_0 = 0, start_sin90_120 = 247
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 73 www.trinamic.com 15 abn incremental encoder interface the tmc5 062 is equipped with two incremental encoder interfaces for abn encoders. the encoder inputs are multiplexed with other signals in order to keep the pin count of the device low. the basic selection of the peripheral configuration is set by the register gco nf . the u se of the n channel is optional, as some applications might use a reference switch or stall detection rather than an encoder n channel for position referencing. the encoders give positions via digital incremental quadrature signals (usually named a and b) and a clear signal (usually named n for null or z for zero). n s ignal the n signal can be used to clear the position counter or to take a snapshot. to continuously monitor the n channel and trigger clearing of the encoder position or latching of the position, where the n channel event has been detected, set the flag clr_cont . alternatively it is possible to react to the next encoder n channel event only, and automatically disable the clearing or latching of the encoder position after the first n signal event (flag clr_once ) . this might be desired because the encoder gives this signal once for each revolution. some encoders require a validation of the n signal by a certain configuration of a and b polarity. this can be controlled by pol_a and pol _b flags in the encmode register. for example, when both pol_a and pol_b are set, an active n - event is only accepted during a high polarity of both, a and b channel. for clearing the encoder position enc_pos with the next active n event set clear_on_n = 1 and clr_once = 1 or clr_cont = 1. f igure 15 . 1 outline of abn signals of an incremental encoder t he e ncoder c onstant enc_const the encoder constant enc_const is added to or sub tracted from the encoder counter on each polarity change of the quadrature signals ab of the incremental encoder. the encoder constant enc_const represents an signed fixed point number (16.16) to facilitate the generic adaption between motors and encoders. in decimal mode, the lower 16 bits represent a number between 0 and 9999. for stepper motors equipped with incremental encoders the fixed number representation allows very comfortable parameterization. additionally, mechanical gearing can easily be taken into account. negating the sign of enc_const allows inversion of the counting direction to match motor and encoder direction. example s : - encoder factor of 1.0: enc_const = 0x0001.0x0000 = factor.fraction - encoder factor of - 1.0: enc_const = 0xffff.0x0000. this is the twos complement of 0x00010000. it equals (2^16 - (factor+1)).(2^16 - fraction) - decimal mode encoder factor 25.6: 00025.6000 = 0x0019.0x1770 = factor.decimals - decimal mode encoder factor - 25.6: 0xffe6.4000 = 0xffe6.0x0fao. this equals (2^16 - (factor +1)).(10000 - decimals) a b t p o s i t i o n - 4 - 3 - 2 - 1 0 5 6 4 3 2 1 7 n
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 74 www.trinamic.com t he e ncoder c ounter x_enc the encoder counter x_enc holds the current encoder position ready for read out. different modes concerning handling of the signals a, b, and n take into account active low and active high signals found wit h different types of encoders. for more details please refer to the register mapping in section 6.3 . t he r egister enc_status the register enc_status holds the status concerning the event of an encoder clear upon an n channel s ignals. the register enc_latch stores the actual encoder position on an n signal event. 15.1 encoder timing the encoder inputs use analog and digital filtering to ensure reliable operation even with increased cable length. the maximum continuous counting rate is limited by input filtering to 2/3 of f clk . encoder interface timing ac - characteristics clock period is t clk parameter symbol conditions min typ max unit e ncoder counting frequency f cnt <2/3 f clk f clk a/b/n input low time t abnl 3 t clk +20 ns a /b/n input high time t abnh 3 t clk +20 ns a/b/n spike filtering time t filtabn r ising and falling edge 3 t clk 15.2 setting the encoder to match motor resolution encoder example settings for motor parameters: usc=256 steps, 200 fullstep motor factor = fs c*usc / encoder resolution e ncoder example setti ngs for a 200 fullstep motor with 256 microsteps encoder resolution r equired encoder factor c omment 200 256 360 142.2222 = 9320675.5555 / 2^16 = 1422222.2222 / 10000 no exact match possible! 500 102.4 = 6710886.4 / 2^16 = 1024000 / 10000 e xact match with decimal setting 1000 51.2 e xact match with decimal setting 1024 50 4000 12.8 e xact match with decimal setting 4096 12.5 16384 3.125 example : the encoder constant register shall be programmed to 51.2 in decimal mode. therefore, set ??? _ ????? = 51 ? 2 16 + 0 . 2 ? 10000 15.3 closing the loop depending on the application, an encoder can be used for different purposes. medical applications often require an additional and independent monitoring to det ect hard or soft failure. upon failure, the machine can be stopped and restarted manually. less critical applications may use the encoder to detect failure, stop the motors upon step loss and restart automatically. a different use of the encoder
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 75 www.trinamic.com allows inc reased positioning precision by positioning directly to encoder positions. the application can modify target positions based on the deviation, or even regularly update the actual posi tion with the encoder position.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 76 www.trinamic.com 16 quick configuration guide this guide is meant as a practical tool to come to a first configuration and do a minimum set of measurements and decisions for tuning the driver. it does not cover all advanced functionalities, but concentrates on the basic function set to make a motor run smoothly. o nce the motor runs, you may decide to explore additional features, e.g. freewheeling and further functionality in more detail. a current probe on one motor coil is a good aid to find the best settings, but it is not a must. c urrent s etting and s etting up spread c ycle figure 16 . 1 current setting and setting up spreadcycle c u r r e n t s e t t i n g c h o p c o n f s e t v s e n s e f o r m a x . 1 8 0 m v a t s e n s e r e s i s t o r ( 0 r 1 5 : 1 . 1 a p e a k ) s e t i _ r u n a s d e s i r e d u p t o 3 1 , i _ h o l d 7 0 % o f i _ r u n o r l o w e r l o w c u r r e n t r a n g e ? n y s e t i _ h o l d _ d e l a y t o 1 t o 1 5 f o r s m o o t h s t a n d s t i l l c u r r e n t d e c a y s e t t _ z e r o w a i t u p t o 6 5 5 3 5 f o r d e l a y e d s t a n d s t i l l c u r r e n t r e d u c t i o n c o n f i g u r e c h o p p e r t o t e s t c u r r e n t s e t t i n g s c h e c k h a r d w a r e s e t u p a n d m o t o r r m s c u r r e n t s p r e a d c y c l e c o n f i g u r a t i o n c h o p c o n f e n a b l e c h o p p e r u s i n g b a s i c c o n f i g . : t o f f = 5 , t b l = 2 , h s t a r t = 0 , h e n d = 0 m o v e t h e m o t o r b y s l o w l y a c c e l e r a t i n g f r o m 0 t o v m a x o p e r a t i o n v e l o c i t y m o n i t o r s i n e w a v e m o t o r c o i l c u r r e n t s w i t h c u r r e n t p r o b e a t l o w v e l o c i t y c h o p c o n f i n c r e a s e h e n d ( m a x . 1 5 ) c u r r e n t z e r o c r o s s i n g s m o o t h ? n m o v e m o t o r v e r y s l o w l y o r t r y a t s t a n d s t i l l c h o p c o n f s e t t o f f = 4 ( m i n . 3 ) , t r y l o w e r / h i g h e r t b l o r r e d u c e m o t o r c u r r e n t a u d i b l e c h o p p e r n o i s e ? y y m o v e m o t o r a t m e d i u m v e l o c i t y o r u p t o m a x . v e l o c i t y a u d i b l e c h o p p e r n o i s e ? c h o p c o n f d e c r e a s e h e n d a n d i n c r e a s e h s t a r t ( m a x . 7 ) y f i n i s h e d o r e n a b l e c o o l s t e p
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 77 www.trinamic.com m oving the m otor u sing the m otion c ontroller figure 16 . 2 moving the motor using the motion controller r a m p m o d e s e t v e l o c i t y _ p o s i t i v e s e t a m a x = 1 0 0 0 , s e t v m a x = 1 0 0 0 0 0 o r d i f f e r e n t v a l u e s m o t o r m o v e s , c h a n g e v m a x a s d e s i r e d m o v e m o t o r c o n f i g u r e r a m p p a r a m e t e r s r a m p m o d e s e t p o s i t i o n s t a r t v e l o c i t y s e t v s t a r t = 1 . h i g h e r v e l c o i t y f o r a b r u p t s t a r t ( l i m i t e d b y m o t o r ) . s t o p v e l o c i t y s e t v s t o p = 2 , b u t n o t b e l o w v s t a r t . h i g h e r v e l o c i t y f o r a b r u p t s t o p . c o n f i g u r e r a m p p a r a m e t e r s m o v e t o t a r g e t s e t x t a r g e t n e w o n - t h e - f l y t a r g e t ? * y e v e n t _ p o s _ r e a c h e d a c t i v e ? n n y t a r g e t i s r e a c h e d c h a n g e o f a n y p a r a m e t e r d e s i r e d ? n s e t m o t i o n p a r a m e t e r a s d e s i r e d y s e t a c c e l e r a t i o n a 1 a s d e s i r e d b y a p p l i c a t i o n d e t e r m i n e v e l o c i t y , w h e r e m a x . m o t o r t o r q u e o r c u r r e n t s i n k s a p p r e c i a b l y , w r i t e t o v 1 a m a x : s e t l o w e r a c c e l e r a t i o n t h a n a 1 t o a l l o w m o t o r t o a c c e l e r a t e u p t o v m a x s e t d e s i r e d m a x i m u m v e l o c i t y t o v m a x d m a x : u s e s a m e v a l u e a s a m a x o r h i g h e r d 1 : u s e s a m e v a l u e a s a 1 o r h i g h e r r e a d y t o m o v e t o t a r g e t * ) f o r o n - t h e - f l y t a r g e t c h a n g e , s e t v s t o p = 2 , v s t a r t = 1 a n d t z e r o w a i t = 0 . p l e a s e a l s o r e f e r r a m p g e n e r a t o r r e s t r i c t i o n s .
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 78 www.trinamic.com e nabling cool s tep ( in c ombination with spre ad c ycle ) figure 16 . 3 enabling coolstep (in combination with spreadcycle) e n a b l e c o o l s t e p m o v e t h e m o t o r b y s l o w l y a c c e l e r a t i n g f r o m 0 t o v m a x o p e r a t i o n v e l o c i t y d o e s s g _ r e s u l t g o d o w n t o 0 w i t h l o a d ? m o n i t o r s g _ r e s u l t v a l u e d u r i n g m e d i u m v e l o c i t y a n d c h e c k r e s p o n s e w i t h m e c h a n i c a l l o a d i s c o i l c u r r e n t s i n e - s h a p e d a t v m a x ? d e c r e a s e v m a x n y i n c r e a s e s g t y c o o l c o n f e n a b l e c o o l s t e p b a s i c c o n f i g . : s e m i n = 1 , a l l o t h e r 0 n s e t v h i g h f o r u p p e r c o o l s t e p v e l o c i t y l i m i t s e t v c o o l t h r s t o t h e l o w e r v e l o c i t y l i m i t f o r c o o l s t e p m o n i t o r c s _ a c t u a l d u r i n g m o t i o n i n v e l o c i t y r a n g e a n d c h e c k r e s p o n s e w i t h m e c h a n i c a l l o a d d o e s c s _ a c t u a l r e a c h i r u n w i t h l o a d b e f o r e m o t o r s t a l l ? i n c r e a s e s e m i n o r c h o o s e n a r r o w e r v e l o c i t y l i m i t s n c 2 c 2 m o n i t o r c s _ a c t u a l a n d m o t o r t o r q u e d u r i n g r a p i d m e c h a n i c a l l o a d i n c r e m e n t w i t h i n a p p l i c a t i o n l i m i t s d o e s c s _ a c t u a l r e a c h i r u n w i t h l o a d b e f o r e m o t o r s t a l l ? i n c r e a s e s e u p n f i n i s h e d
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 79 www.trinamic.com s etting up dc s tep figure 16 . 4 setting up dcstep e n a b l e d c s t e p d o e s t h e m o t o r r e a c h v m a x a n d h a v e g o o d t o r q u e ? s t a r t t h e m o t o r a t t h e t a r g e t e d v e l o c i t y v m a x a n d t r y t o a p p l y l o a d i n c r e a s e d c _ t i m e n y c h o p c o n f m a k e s u r e , t h a t t o f f i s n o t l e s s t h a n 3 . u s e l o w e s t g o o d t b l . s e t v h i g h f s a n d v h i g h c h m u s e a s t a l l g u a r d t h r e s h o l d v e l o c i t y s l i g h t l y a b o v e v d c m i n f o r e n a b l i n g s t a l l g u a r d b y s o f t w a r e b a s e d o n v a c t u a l s e t v d c m i n t o a b o u t 5 % t o 2 0 % o f t h e d e s i r e d o p e r a t i o n v e l o c i t y d c c t r l s e t d c _ t i m e d e p e n d i n g o n t b l : % 0 0 : 1 7 ; % 0 1 : 2 5 % 1 0 : 3 7 ; % 1 1 : 5 5 d o e s t h e m o t o r r e a c h v d c m i n w i t h o u t s t e p l o s s ? r e s t a r t t h e m o t o r a n d t r y t o s l o w i t d o w n t o v d c m i n b y a p p l y i n g l o a d d e c r e a s e d c _ t i m e o r i n c r e a s e t o f f o r i n c r e a s e v d c m i n n y d c c t r l s e t d c _ s g t o 1 + 1 / 1 6 t h e v a l u e o f d c _ t i m e s w _ m o d e e n a b l e s g _ s t o p t o s t o p t h e m o t o r u p o n s t a l l d e t e c t i o n f i n i s h e d o r c o n f i g u r e d c s t e p s t a l l d e t e c t i o n c o n f i g u r e d c s t e p s t a l l d e t e c t i o n d o e s t h e m o t o r s t o p u p o n t h e f i r s t s t a l l ? s l o w d o w n t h e m o t o r t o v d c m i n b y a p p l y i n g l o a d . f u r t h e r i n c r e a s e l o a d t o s t a l l t h e m o t o r . i n c r e a s e d c _ s g n y r e a d o u t r a m p _ s t a t t o c l e a r e v e n t _ s t o p _ s g a n d r e s t a r t t h e m o t o r a c c e l e r a t e t h e m o t o r f r o m 0 t o v m a x d o e s t h e m o t o r s t o p d u r i n g a c c e l e r a t i o n ? i n c r e a s e s t a l l g u a r d t h r e s h o l d v e l o c i t y a s s e t b y s o f t w a r e y n f i n i s h e d
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 80 www.trinamic.com 17 getting started please refer to the TMC5062 evaluation board to allow a quick start with the device, and in order to allow interactive tuning of the device setup in your application. chapter 16 will guide you through the process of correctly setting up all registers. 17.1 initialization examples initialization spi datagram example sequence t o enable and initialize driver 1 and ramp generator 1 to move the motor in velocity mode and read access the position register : spi send: 0x8000000008; // gconf=8: enable pp and int outputs spi send: 0xec00010 0c 5; // chopconf: toff=5, hstrt=4, hend= 1 , tbl=2, chm=0 (spreadcycle) spi send: 0xb000011f05; // ihold_irun: ihold=5, irun=31 (max. current), iholddelay=1 spi send: 0xa600001388; // amax=5000 spi send: 0xa700004e20; // vmax=20000 spi send: 0xa000000001; // rampmode=1 (positive velocity) // now motor 1 should start rotating spi send: 0x2100000000; // query x actual C the next read access delivers x actual spi read; // read x actual initialization spi datagram example sequence to enable and initialize the motion controller and then mo ve one rotation (51200 microsteps) using the ramp generator. spi send: 0xa4000003e8; // a1 = 1 000 first acceleration spi send: 0xa50000c350; // v1 = 50 000 acceleration threshold velocity v1 spi send: 0xa6000001f4; // amax = 500 acceleration above v1 spi send: 0xa7000304d0; // vmax = 200 000 spi send: 0xa8000002bc; // dmax = 700 deceleration above v1 spi send: 0xaa00000578; // d1 = 1400 deceleration below v1 spi send: 0xab0000000a; // vstop = 10 stop velocity (near to zero) spi send: 0xa00000000 0 ; // rampmode = 0 (target position move) // ready to move! spi send: 0xadffff3800; // xtarget = - 51200 (move one rotation left (200*256 microsteps) ) for uart based operation it is important to make sure that the crc byte is correct. the following exampl e shows initialization for a TMC5062. it programs driver 1 and ramp generator 1 to move the motor in velocity mode and read accesses the position and actual velocity registers: uart write: 0x05 0xec 0x00 0x71 0x03 0x06 0x45; // toff=6 , hend=6 , sync=7 , hs tr=0 , // tbl=2 , mres=0 , chm=0 uart write: 0x05 0xb0 0x00 0x01 0x14 0x05 0x47; // ihold=5, irun=20, iholddelay=1 uart write: 0x05 0xa6 0x00 0x00 0x13 0x88 0xa4; // amax=5000 uart write: 0x05 0xa7 0x00 0x00 0x4e 0x20 0x95; // vmax=20000 uart write: 0 x05 0xa0 0x00 0x00 0x00 0x01 0xb3; // rampmode=1 (positive velocity) // now motor 1 should start rotating uart write: 0x05 0x21 0x8d ; // query xactual uart read 7 bytes; uart write : 0x05 0x22 0xc3 ; // query vactual uart read 7 bytes; hint tune th e configuration parameters for your motor and application for optimum performance.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 81 www.trinamic.com 18 clock oscillator and clock input the clock is the tim ing reference for all functions: the chopper, the velocity , the acceleration control, etc. many parameters are scaled with the clock frequency, thus a precise reference allows a more deterministic result. the on - chip clock oscillator provides timing in case no external clock is easily available. 18.1 using the internal clock directly tie the clk input to gnd near to the tmc5 062 if the internal clock oscillator is to be used. t he internal clock can be calibrated by driving the ramp generator at a certain velocity setting. reading out position values via the interface and comparing the resulting velocity to the remote masters clock gives a time reference. a similar procedure also is described in 13.5 . this allows scaling acceleration and velocity settings as a result. the temperature dependency and ageing of the internal clock is com paratively low. i mplementing f requency d ependent s caling frequency dependent scaling allows using the internal clock for a motion control application. the time reference of the external microcontroller is used to calculate a scaler for all velocity settin gs. the following steps are required: 1. you may leave the motor driver disabled during the calibration. 2. start motor in velocity mode, with vmax =10000 and amax =60000 ( for quick acceleration). the acceleration phase is ended after a few ms. 3. read out xactual t wice, at time point t1 and time point t2, e.g. 100ms later (dt=0.1s). the time difference between both read accesses shall be exactly timed by the external microcontroller. 4. stop the motion ramp by setting vmax =0. 5. the number of steps done in between of t1 a nd t2 now can be used to calculate the factor ? = ???? ? ?? ??????? ( ? 2 ) ? ??????? ( ? 1 ) = 1000 ??????? ( ? 2 ) ? ??????? ( ? 1 ) 6. now multiply each velocity value with this factor f, to normalize the velocity to steps per second. at a nominal value of the internal clock frequency, 780 steps will be done in 100ms. hint in case well defined velocity settings and precise motor chopper operation are desired, it is supposed to work with an external clock source. 18.2 using an external cloc k when an external clock is available, a frequency of 1 0 mhz to 16 mhz is recommended for optimum performance. the duty cycle of the clock signal is uncritical, as long as minimum high or low input time for the pin is satisfied (refer to electrical characteristics). up to 18 mhz can be used, when the clock duty cycle is 50%. make sure, that the clock source supplies clean cmos output logic levels and steep slopes when using a high clock frequency. the external clock input is enabled with the first positive polarity seen on the clk input. attention switching of f the external clock frequency prevents the driver from operating normally. therefore be careful to switch off the motor drivers before switching off the clock (e.g. using the enable input), because otherwise the chopper would stop and the motor current le vel could rise uncontrolled. the short to gnd detection stays active even without clock, if enabled. 18.3 considerations on the frequency a higher frequency allows faster step rates, faster spi operation and higher chopper frequencies. on the other hand, it m ay cause more electromagnetic emission of the system and causes more power dissipation in the TMC5062 digital core and voltage regulator. generally a frequency of 1 0 mhz to 16
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 82 www.trinamic.com mhz should be sufficient for most applications. for reduced requirements concerning the motor dynamics, a clock frequency of down to 8 mhz can be considered.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 83 www.trinamic.com 19 absolute maximum ratings the maximum ratings may not be exceeded under any circumstanc es. operating the circuit at or near more than one maximum rating at a time for extended periods shall be avoided by application design. parameter symbol min max unit supply voltage operating with inductive load (v vs v vsa ) v vs - 0.5 22 v i/o supply vol tage v vio - 0.5 5.5 v digital vcc supply voltage (if not supplied by internal regulator) v vcc - 0.5 5.5 v logic input voltage v i - 0.5 v vio +0.5 v maximum current to / from digital pins and analog low voltage i/os i io +/ - 10 ma 5v regulator output current (internal plus external load) i 5vout 50 ma 5v regulator continuous power dissipation (v vm - 5v) * i 5vout p 5vout 1 w power b ridge repetitive output current i ox 2.0 a junction temperature t j - 50 150 c storage temperature t stg - 55 150 c esd - protectio n for interface pins (human body model, hbm) v esdap 4 (tbd.) kv esd - protection for handling (human body model, hbm) v esd 1 (tbd.) kv 20 electrical characteristics 20.1 operational range parameter symbol min max unit junction temperature t j - 40 125 c supply voltage (using internal +5v regulator) v vs 5.5 20 v supply voltage (internal +5v regulator bridged: v vcc =v vsa ) v vs 4.7 5.4 v i/o supply voltage v vio 3.00 5.25 v vcc voltage when using optional external source (supplies digital logic and charge pump) v vcc 4.75 5.25 v rms motor coil current per coil (value for design guideline) i rms 0.8 a peak output current per motor coil output (sine wave peak) i ox 1.1 a peak output current per motor coil output (sine wave peak) limit t j 105c , e.g. for 100ms sh ort time acceleration phase below 50% duty cycle. i ox 1. 5 a
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 84 www.trinamic.com 20.2 dc characteristics and timing characteristics dc characteristics contain the spread of values guaranteed within the specified supply voltage range unless otherwise specified. typical values re present the average value of all parts measured at +25c. temperature variation also causes stray to some values. a device with typical values will not leave min/max range within the full temperature range. power supply current dc - characteristics v vs = 16 .0v parameter symbol conditions min typ max unit supply current, driver disabled i vs f clk =16mhz 30 40 ma supply current, operating i vs f clk =16mhz, 40khz chopper 33 ma static supply current i vs0 f clk =0hz 7 ma supply current, driver disabled, depen dency on clk frequency i vs x f clk variable, additional to i vs0 1.6 ma/mhz internal current consumption from 5v supply on vcc pin i vcc f clk =16mhz, 40khz chopper 30 40 ma io supply current i vio no load on outputs, inputs at v io or gnd 10 a motor dr iver section dc - and timing - characteristics v vs = 16 .0v parameter symbol conditions min typ max unit rds on lowside mosfet r onl measure at 100ma, 25c, static state 0.4 0.5 ? on highside mosfet r onh measure at 100ma, 25c, static state 0.5 0.6 ? slpon measured at 700ma load current 120 250 ns slope, mosfet turning off t slpoff measured at 700ma load current 220 450 ns current sourcing, driver off i oidle o xx pulled to gnd 120 180 250 a charge pump dc - characteristics p arameter symbol conditions min typ max unit charge pump output voltage v vcp - v vs operating, typical f chop <40khz 4.0 v 5vout - 0.4 v 5vout v charge pump voltage threshold for undervoltage detection v vcp - v vs using internal 5v regulator voltage 3.1 3.6 3.9 v c harge pump frequency f cp 1/16 f clkosc linear regulator dc - characteristics parameter symbol conditions min typ max unit output voltage v 5vout i 5vout = 0ma t j = 25c 4.75 5.0 5.25 v output resistance r 5vout static load 3 ? 5vout(dev) i 5vout = 30ma t j = full range 30 100 mv
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 85 www.trinamic.com clock oscillator and input timing - characteristics parameter symbol conditions min typ max unit clock oscillator frequency f clkosc t j = - 50c 8.8 12.4 17.9 mhz cl ock oscillator frequency f clkosc t j =50c 9.4 13.2 18.8 mhz clock oscillator frequency f clkosc t j =150c 9.6 13.4 18.9 mhz external clock frequency (operating) f clk 8 1 0 - 16 18 mhz external clock high / low level time t clk l / t clk h clk driven to 0.1 v vio / 0.9 v vio 25 ns detector levels dc - characteristics parameter symbol conditions min typ max unit v vs a undervoltage threshold for reset v uv _vsa v vs a rising 3.8 4.2 4.6 v v 5vout undervoltage threshold for reset v uv _5vout v 5vout rising 3.5 v short to gnd d etector threshold (v vsp - v ox ) v os2g 1.5 2.2 3 v short to gnd detector delay (high side switch on to short detected) t s2g high side output clamped to v sp - 3v 0.8 1.3 2 s overtemperature prewarning t otpw temperature rising 100 120 140 c overtemperature shutdown t ot temperature rising 135 150 170 c sense resistor voltage levels dc - characteristics parameter symbol conditions min typ max unit sense input peak threshold voltage (low sensitivity) v srtl vsense =0 csactual =31 sin_x =248 hyst.=0; i brxy =0 32 0 mv sense input peak threshold voltage (high sensitivity) v srth vsense =1 csactual =31 sin_x =248 hyst.=0; i brxy =0 180 mv sense input tolerance / motor current full scale tolerance i coil vsense =0 - 5 +5 % internal resistance from pin brxy to internal sense comparator (additional to sense resistor) r brxy 20 m? digital pins dc - characteristics parameter symbol conditions min typ max unit input voltage low level v inlo - 0.3 0.3 v vio v input voltage high level v inhi 0.7 v vio v vio +0.3 v input schmitt trigger hysteresis v inhyst 0.12 v vio v output voltage low level v outlo i outlo = 2ma 0.2 v output voltage high level v outhi i outhi = - 2ma v vio - 0.2 v input leakage current i ileak - 10 10 a digital pin capacitance c 3.5 pf
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 86 www.trinamic.com 20.3 thermal characteristics the following table shall give an idea on the thermal resistance of the qfn - 48 package. the thermal resistance for a four layer board will provide a good idea on a typical application. the single layer board example is kind of a worst case condition, as the typical app lication will require a 4 layer board. actual thermal characteristics will depend on the pcb layout, pcb type and pcb size. a thermal resistance of 23c/w for a typical board means, that the package is capable of continuously dissipating 4w at an ambient temperature of 25c with the die temperature staying below 125c. parameter symbol conditions typ unit typical power dissipation one motor active, one motor in standby at low current p d one motor 1.00a rms 115c (125c) one motor 0.71a rms 85c (93c) s urface temperature at package center (peak surface temperature), board 55mm x 85mm, 25c environment stealthchop or spreadcycle, s inewave, 20khz chopper, 2 0 v , 16mhz , internal supply for vcc motors: qsh4218 - 035 - 10 - 027 3.7 2.4 w w typical power dissipatio n two motors active p d two motors 0.71a rms 113c (119c) two motors 0.35a rms 64c (68c) 3.7 1.4 w w thermal resistance junction to ambient on a single layer board r tja single signal layer board (1s) as defined in jedec eia jesd51 - 3 (fr4, 76.2mm x 114. 3mm, d=1.6mm) 80 k/w thermal resistance junction to ambient on a multilayer board r tmja dual signal and two internal power plane board (2s2p) as defined in jedec eia jesd51 - 5 and jesd51 - 7 (fr4, 76.2mm x 114.3mm, d=1.6mm) 23 k/w thermal resistance juncti on to ambient on a multilayer board with air flow r tmja1 identical to r tmja , but with air flow 1m/s 20 k/w thermal resistance junction to board r tjb pcb temperature measured within 1mm distance to the package 10 k/w thermal resistance junction to case r t jc junction temperature to heat slug of package 3 k/w the thermal resistance in an actual layout can be tested by checking for the heat up caused by the standby power consumption of the chip. when no motor is attached, all power seen on the power supply is dissipated within the chip. note a spread - sheet for calculating tmc50 62 power dissipation is available on www.trinamic.com.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 87 www.trinamic.com 21 layout considerations 21.1 exposed die pad the TMC5062 uses its die attach pad to dissipate heat from the drivers and the linear r egulator to the board. for best electrical and thermal performance, use a reasonable amount of solid, thermally conducting vias between the die attach pad and the ground plane . the printed circuit board should have a solid ground plane spreading heat into the board and providing for a stable gnd reference. 21.2 wiring gnd all signals of the TMC5062 are referenced to their respective gnd. directly connect all gnd pins under the TMC5062 to a common ground area (gnd, gndp, gnda and die attach pad). the gnd plane right below the die attach pad should be treated as a virtual star point. for thermal reasons, the pcb top layer shall be connected to a large pcb gnd plane spreading heat within the pcb. attention especially, the sense resistors are susceptible to gnd d ifferences and gnd ripple voltage, as the microstep current steps make up for voltages down to 0.5 mv. no current other than the sense resistor current should flow on their connections to gnd and to the TMC5062 . optimally place them close to the TMC5062 , with one or more vias to the gnd plane for each sense resistor. the two sense resistors for one coi l should not share a common ground connection trace or vias, as also pcb traces have a certain resistance. 21.3 supply filtering the 5vout output voltage ceramic filtering capacitor (4.7 f recommended) should be placed as close as possible to the 5vout pin, w ith its gnd return going directly to the gnda pin. use as short and as thick connections as possible. for best microstepping performance and lowest chopper noise an additional filtering capacitor can be used for the vcc pin to gnd, to avoid charge pump and digital part ripple influencing motor current regulation. therefore place a ceramic filtering capacitor (470nf recommended) as close as possible (1 - 2mm distance) to the vcc pin with gnd return going to the ground plane. vcc can be coupled to 5vout using a 2.2 ? resistor in order to supply the digital logic from 5vout while keeping ripple away from this pin. a 100 nf filtering capacitor should be placed as close as possible to the vsa pin to ground p lane. the motor supply pins vs should be decoupled with a n electrolytic capacitor (47 f or larger is recommended) and a ceramic capacitor, placed close to the device. take into account that the switching motor coil outputs have a high dv/dt. t hus capacitive stray into high resistive signals can occur, if the motor traces are near other traces over longer distances.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 88 www.trinamic.com 21.4 layout e xample schematic 1 - top l ayer (assembly side) 2 - inner l ayer (gnd) 3 - inner l ayer (supply vs) 4 - bottom l ayer c omponents f igure 21 . 1 layout example
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 89 www.trinamic.com 22 package mechanical data 22.1 dimensional drawing s attention: drawings not to scale. f igure 22 . 1 dimensional drawings p arameter ref min nom max total thickness a 0.80 0.85 0.90 st and off a1 0.00 0.035 0.05 mold thickness a2 - 0.65 0.67 lead frame thickness a3 0.203 lead width b 0.2 0.25 0.3 body size x d 7.0 body size y e 7.0 lead pitch e 0.5 exposed die pad size x j 5.2 5.3 5.4 exposed die pad size y k 5.2 5.3 5.4 lead length l 0.35 0.4 0.45 package edge tolerance aaa 0.1 mold flatness bbb 0.1 coplanarity ccc 0.08 lead offset ddd 0.1 exposed pad offset eee 0.1 22.2 package codes type package temperature range code & marking TMC5062 - la qfn48 (rohs) - 40 c ... +125c TMC5062 - la
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 90 www.trinamic.com 23 disclaimer trinamic motion control gmbh & co. kg does not authorize or warrant any of its products for use in life support systems, without the specific written consent of trinamic motion control gmbh & co. kg. life support system s are equipment intended to support or sustain life, and whose failure to perform, when properly used in accordance with instructions provided, can be reasonably expected to result in personal injury or death. information given in this data sheet is belie ved to be accurate and reliable. however no responsibility is assumed for the consequences of its use nor for any infringement of patents or other rights of third parties which may result from its use. specifications are subject to change without notice. all trademarks used are property of their respective owners. 24 esd sensitive device the TMC5062 is an esd sensitive cmos device sensitive to electrostatic discharge. take special care to use adequate grounding of personnel and machines in manual handling. after soldering the devices to the board, esd requirements are more relaxed. failure to do so can result in defect or decreased reliability.
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 91 www.trinamic.com 25 table of f igures figure 1.1 basic application and b lock diagram ................................ ................................ ................................ .......... 5 figure 1.2 energy efficiency with coolstep (example) ................................ ................................ ............................... 8 figure 2.1 TMC5062 pin assignments. ................................ ................................ ................................ ............................. 9 figure 3.1 standard application circuit ................................ ................................ ................................ ......................... 12 figure 3.2 external supply of vcc_io (showing optional filtering for vcc) ................................ ...................... 13 figure 3.3 5v only operation ................................ ................................ ................................ ................................ ........... 14 figure 3.4 using an external 5v supply to reduce linear regulator power dissipation ................................ . 15 figure 3.5 using an external 5v supply to bypass internal regulator ................................ ................................ 15 figure 3.6 adding an rc - filter on vcc for reduced ripple ................................ ................................ ..................... 16 figure 3.7 simple esd enhancement and more elaborate motor output protection ................................ .... 17 figure 4.1 spi timing ................................ ................................ ................................ ................................ ......................... 20 figure 5.1 connecting to a master via single wire uart interface ................................ ................................ ..... 24 figure 5.2 connecting to a master via differential uart interface ................................ ................................ ...... 24 figure 8.1 chopper phases ................................ ................................ ................................ ................................ .............. 45 figure 8.2 no ledges in current wave with sufficient hysteresis (magenta: current a, yellow & blue: sense resistor voltages a and b) ................................ ................................ ................................ ................................ ... 47 figure 8.3 spreadcycle chopper scheme showing coil current during a chopper cycle ............................... 48 figure 8.4 classic const. off time chopper with offset showing coil current ................................ ................... 49 figure 8.5 zero crossing with classic chopper and correction using sine wave offset ................................ . 49 figure 10.1 ramp generator velocity trace showing consequent move in negative direction ................... 54 figure 10.2 illustration of optimized motor torque usage with TMC5062 ramp generator ......................... 55 figure 10.3 ramp generator velocity dependent motor control ................................ ................................ .......... 56 figure 10.4 using reference switches (example) ................................ ................................ ................................ ....... 57 figure 11.1 function principle of stallguard2 ................................ ................................ ................................ ............ 61 figure 11.2 example: optimum sgt setting and stallguard2 reading with an example motor ................. 63 figure 12.1 coolstep adapts motor current to the load ................................ ................................ ......................... 66 figure 13.1 dcstep extended application operation area ................................ ................................ ....................... 68 figure 13.2 velocity profile with impact by overload situation ................................ ................................ ........... 69 figure 14.1 lut programming example ................................ ................................ ................................ ....................... 71 figur e 15.1 outline of abn signals of an incremental encoder ................................ ................................ ........... 73 figure 16.1 current setting and setting up spreadcycle ................................ ................................ ......................... 76 figure 16.2 moving the motor using the motion controller ................................ ................................ ................. 77 figure 16.3 enabling coolstep (in combination with spreadcycle) ................................ ................................ ..... 78 figure 16.4 setting up dcstep ................................ ................................ ................................ ................................ ......... 79 figure 21.1 layout example ................................ ................................ ................................ ................................ ............. 88 figure 22.1 dimensional drawings ................................ ................................ ................................ ................................ 89
TMC5062 datasheet (rev. 1.10 / 201 6 - apr - 28) 92 www.trinamic.com 26 revisi on history version date author bd C bernhard dwersteg sd C sonja dwersteg description 1.04 2012_nov - 14 bd first version of product tmc5 0 62 datasheet based on tmc562 prototype datasheet . features modified over previous prototype datasheet : - adapted volt age rating to 16 v operational, 18 v max. - added maximum ratings for short time current feature set is application specific tailored compared to tmc562 engineering samples: no 3 phase support, dual motor operation only, single wire with single slave only (t ie former address pin nextaddr to gnd) , use of internal sequencer only, 256 microsteps only f ormer versions of the tmc562 datasheet are no longer valid for this product . 1.05 2012 - dec - 11 jp pack age information updated. 1.06 2014 - feb - 28 sd - chapter 20.3 (thermal characteristics) added. - chapter 11.1 (tuning the stallguard2 threshold) updated. - csactual in drv_status corrected (chapter 6.4.4 ). - interrupt output remark in ra mp_stat for status_latch_l and status_latch_r removed. description event_stop_l and event_stop_r updated (chapter 6.2.2.2 ) - sw_mode register updated (chapter 6.2.2.1 ) . - order codes updated. - new desc ription of vcc_io requirements (chapter 3.1.1 ) . - en_latch_encoder updated. - chapter 15 (abn encoder information) updated. - second spi initialization example using ramp generator added. - information a bout dcstep improved. 1.07 2014 - may - 12 sd - standard application circuit new (chapter 3.1 ) : information about 3.3v operation added. - motor current calculation updated 1.08 2014 - jul - 01 bd integrated errata sheet v1.1 & workaro und in 10 .5 1.09 2015 - mar - 23 bd stallguard stop details: improved homing algorithm, added 1 1 .4, text for event_stop_sg, improved 1 3 .4, limits vcp uv , detail wording in many chapters, 320mv vsrtl, spi example, added chapter closing the loop. added uart int erface errata. explanation vactual sign, improved blue blocks, added quick configuration guide 1.10 2016 - apr - 28 bd corrected toff calculation example, comments in gstat, comment on spi_status, 5v only + - 5% , x1=128 in microstep table defaults , setting negative encoder factors, adaptation to internal fclk , interrupt handling , wording v1 and vmax register , esd schematic w. varistors instead of snubber t able 26 . 1 documentation revisions 27 references [an001] trinamic application note 001 - parameterization of spreadc ycle? , www.trinamic.com [an002] trinamic application note 002 - parameterization of stallguard2? & coolstep? , www.trinamic.com [an02 7 ] trinamic application note 02 7 - dcstep? with tmc5 0 62 , www.trinamic.com calculation sheet tmc50xx _calculations.xlsx


▲Up To Search▲   

 
Price & Availability of TMC5062

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X